Skip to content

Commit a9ce066

Browse files
committed
restyle eligibility catalog
1 parent 7fc1387 commit a9ce066

3 files changed

Lines changed: 42 additions & 22 deletions

File tree

src/ui/screens/eligibilty-overview/EligibilityOverviewScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const EligibilityOverviewScreen = ({
5353
{featureFlags.bielefunke && atLeastOneWithMissingData() &&
5454
<RegularButton
5555
text={"Noch offene Ansprüche prüfen"}
56-
variant={'blueContained'}
56+
variant={'blackContained'}
5757
link='/onboarding-welcome'
5858
onClick={doSetSelectedBenefits}
5959
endIcon={<EastIcon/>}

src/ui/screens/eligibilty-overview/components/EligibilityOverviewBanner.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
import { Typography } from "@mui/material";
22
import { HBox } from "@/ui/shared-components/LayoutBoxes";
33
import theme from "@/theme";
4+
import ClearIcon from '@mui/icons-material/Clear';
5+
import CheckIcon from '@mui/icons-material/Check';
46

57
const EligibilityOverviewBanner = ({ t, eligible }) => {
68
const eligibilityBannerType = (() => {
79
switch (eligible) {
810
case 'eligible':
911
return {
1012
text: 'app.browseAll.item.eligible',
13+
border: '1px solid rgba(11, 175, 18, 0.2)',
1114
backgroundColor: 'secondary.light'
1215
}
1316
case 'preliminary-eligible':
1417
return {
1518
text: 'app.browseAll.item.preliminaryEligible',
19+
border: '1px solid rgba(11, 175, 18, 0.2)',
1620
backgroundColor: 'yellow.main'
1721
}
1822
case 'non-eligible':
1923
return {
2024
text: 'app.browseAll.item.notEligible',
25+
border: '1px solid rgba(255, 0, 0, 0.2)',
2126
backgroundColor: 'error.light'
2227
}
2328
default:
@@ -28,15 +33,28 @@ const EligibilityOverviewBanner = ({ t, eligible }) => {
2833
}
2934
})();
3035

36+
const eligibilityIcon = (() => {
37+
switch (eligible) {
38+
case 'eligible':
39+
return <CheckIcon sx={{ fontSize: '16px' }} />;
40+
case 'non-eligible':
41+
return <ClearIcon sx={{ fontSize: '16px' }} />;
42+
default:
43+
return <ClearIcon sx={{ fontSize: '16px' }} />;
44+
}
45+
})();
46+
3147
return (
3248
<HBox sx={{
33-
height: 'fit-content',
3449
backgroundColor: eligibilityBannerType.backgroundColor,
35-
padding: "6px 18px",
50+
border: eligibilityBannerType.border || 'none',
51+
padding: '6px 18px',
3652
borderRadius: theme.shape.borderRadius,
3753
alignItems: 'center',
54+
gap: 1,
3855
}}>
39-
<Typography variant="body1" >{t(eligibilityBannerType.text)}</Typography>
56+
<Typography variant="body1">{t(eligibilityBannerType.text)}</Typography>
57+
{eligibilityIcon}
4058
</HBox>
4159
);
4260
}

src/ui/screens/eligibilty-overview/components/EligibilityOverviewItem.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ const EligibilityOverviewItem = ({ t, item, eligible, isDesktop }) => {
2323
const setSelectedBenefits = useSelectedBenefitsStore((state) => state.setSelectedBenefits);
2424
const clearSelectedTopics = useSelectedTopicsStore((state) => state.clear);
2525

26+
const hasFirstSectionChildren =
27+
eligible !== 'indeterminate' ||
28+
(!isVisible && isDesktop && item.benefitCategories?.length > 0);
29+
2630
return (
2731
<VBox
2832
sx={{
@@ -97,37 +101,35 @@ const EligibilityOverviewItem = ({ t, item, eligible, isDesktop }) => {
97101
)}
98102
<HBox sx={{
99103
flexWrap: 'wrap',
100-
gap: { xs: 0, md: 2 },
104+
gap: hasFirstSectionChildren ? 2 : 0,
101105
alignItems: 'center',
102106
justifyContent: 'space-between',
103107
'& > :only-child': { marginLeft: 'auto' }
104108
}}>
105109
<HBox sx={{ gap: 2, alignItems: 'center', flex: { xs: 0, md: 3 } }}>
106-
{
107-
eligible !== 'indeterminate' && (
108-
<HBox>
110+
<HBox sx={{ flexWrap: 'wrap', gap: 1 }}>
111+
{
112+
eligible !== 'indeterminate' && (
109113
<EligibilityOverviewBanner t={t} eligible={eligible} />
110-
</HBox>
111-
)
112-
}
113-
{!isVisible && isDesktop && (
114-
<HBox sx={{ flexWrap: 'wrap', gap: 1 }}>
115-
{item.benefitCategories?.map(tag => (
114+
)
115+
}
116+
{!isVisible && isDesktop &&
117+
item.benefitCategories?.map(tag => (
116118
<EligibilityOverviewTag
117119
key={tag.id}
118120
tag={tag.label}
119121
isDesktop={isDesktop}
120122
tagType="benefitCategories"
121123
/>
122-
))}
123-
</HBox>
124-
)}
124+
))
125+
}
126+
</HBox>
125127
</HBox>
126-
<HBox sx={{
127-
justifyContent: { xs: 'flex-start', md: 'flex-end' },
128-
flexWrap: 'wrap',
129-
gap: 2,
130-
alignItems: 'center',
128+
<HBox sx={{
129+
justifyContent: { xs: 'flex-start', md: 'flex-end' },
130+
flexWrap: 'wrap',
131+
gap: 2,
132+
alignItems: 'center',
131133
flex: 3
132134
}}
133135
>

0 commit comments

Comments
 (0)