feat: Enhance Filter component with collapsible options and clear filter functionality; improve responsiveness and UI feedback on mobile

This commit is contained in:
sebseb7
2026-03-26 14:32:06 +01:00
parent e0c6d47d98
commit 665e48e868
2 changed files with 115 additions and 17 deletions

View File

@@ -1089,6 +1089,8 @@ class ProductDetailPage extends Component {
const { product, loading, upgrading, error, attributeImages, /*isSteckling,*/ attributes, komponentenLoaded, komponentenData, komponentenImages, totalKomponentenPrice, totalSavings, shareAnchorEl, sharePopperOpen, snackbarOpen, snackbarMessage, snackbarSeverity } =
this.state;
const hasAttributeImages = attributes.some((attr) => attributeImages[attr.kMerkmalWert]);
// Debug alerts removed
@@ -1298,7 +1300,19 @@ class ProductDetailPage extends Component {
<Box sx={{ minHeight: "107px", display: "flex", justifyContent: "space-between", alignItems: "flex-start", mb: 2, gap: 2 }}>
{(attributes.some(attr => attributeImages[attr.kMerkmalWert]) || attributes.some(attr => !attributeImages[attr.kMerkmalWert])) && (
<Stack direction="row" spacing={0} sx={{ flexWrap: "wrap", gap: 1, flex: 1 }}>
<Stack
direction="row"
spacing={0}
sx={{
flexWrap: "wrap",
gap: 1,
flex: 1,
display: {
xs: hasAttributeImages ? "flex" : "none",
sm: "flex",
},
}}
>
{attributes
.filter(attribute => attributeImages[attribute.kMerkmalWert])
.map((attribute) => {
@@ -1321,7 +1335,11 @@ class ProductDetailPage extends Component {
key={attribute.kMerkmalWert}
label={attribute.cWert}
disabled
sx={{
sx={(theme) => ({
// Max-width query: reliable on portrait phones (avoids display:contents wrapper quirks)
[theme.breakpoints.down('sm')]: {
display: 'none',
},
'&.Mui-disabled': {
opacity: 1, // ← Remove the "fog"
},
@@ -1329,7 +1347,7 @@ class ProductDetailPage extends Component {
fontWeight: 'bold',
color: 'inherit', // ← Keep normal text color
},
}}
})}
/>
))}
</Stack>