11import React , { useState } from 'react' ;
2- import { Divider , Typography } from '@mui/material' ;
2+ import { Typography } from '@mui/material' ;
33import { HBox , VBox } from '@/ui/shared-components/LayoutBoxes' ;
44import theme from '@/theme' ;
55import RegularButton from '@/ui/shared-components/buttons/RegularButton' ;
@@ -20,7 +20,6 @@ const filterKeys = [
2020
2121const EligibilityOverviewItem = ( { t, item, eligible } ) => {
2222 const [ isVisible , setIsVisible ] = useState ( false ) ;
23- const color = eligible === 'indeterminate' ? 'black.light' : 'black.main' ;
2423 const setSelectedBenefits = useSelectedBenefitsStore ( ( state ) => state . setSelectedBenefits ) ;
2524 const clearSelectedTopics = useSelectedTopicsStore ( ( state ) => state . clear ) ;
2625
@@ -29,10 +28,10 @@ const EligibilityOverviewItem = ({ t, item, eligible }) => {
2928 sx = { {
3029 display : 'flex' ,
3130 flexDirection : 'column' ,
32- gap : 2 ,
31+ gap : 3 ,
3332 border : `1px solid ${ theme . palette . white . dark } ` ,
3433 boxShadow : '0px 1px 2px rgba(0, 0, 0, 0.25)' ,
35- padding : 2 ,
34+ padding : 4 ,
3635 borderRadius : theme . shape . borderRadius ,
3736 } }
3837 >
@@ -53,7 +52,7 @@ const EligibilityOverviewItem = ({ t, item, eligible }) => {
5352 < HBox sx = { { alignItems : 'flex-end' , gap : 2 , flexWrap : 'wrap' , width : '100%' } } >
5453 < HBox sx = { { alignItems : 'center' , justifyContent : 'space-between' , width : '100%' } } >
5554 < HBox sx = { { alignItems : 'center' , gap : 2 , flexWrap : 'wrap' } } >
56- < Typography variant = 'h2' sx = { { color : color , fontWeight : '400' , wordBreak : 'break-word' } } >
55+ < Typography variant = 'h2' sx = { { fontWeight : '400' , wordBreak : 'break-word' } } >
5756 { item . title }
5857 </ Typography >
5958 { item . status === "beta" && (
@@ -84,7 +83,7 @@ const EligibilityOverviewItem = ({ t, item, eligible }) => {
8483 </ VBox >
8584 </ HBox >
8685 </ HBox >
87- < VBox sx = { { gap : 2 } } >
86+ < VBox sx = { { gap : 4 , flex : 1 } } >
8887 { isVisible && (
8988 < HBox sx = { { flexWrap : 'wrap' , gap : 1 } } >
9089 {
@@ -98,36 +97,52 @@ const EligibilityOverviewItem = ({ t, item, eligible }) => {
9897 }
9998 </ HBox >
10099 ) }
101- < Divider sx = { { color : 'dark.light' , borderStyle : 'dashed' } } />
102- < HBox sx = { { flexWrap : 'wrap' , gap : 2 , alignItems : 'center' } } >
103- {
104- eligible !== 'indeterminate' && (
105- < HBox >
106- < EligibilityOverviewBanner t = { t } eligible = { eligible } />
100+ < HBox sx = { {
101+ flexWrap : 'wrap' ,
102+ gap : 2 ,
103+ alignItems : 'center' ,
104+ justifyContent : 'space-between' ,
105+ '& > :only-child' : { marginLeft : 'auto' }
106+ } } >
107+ < HBox sx = { { gap : 2 , alignItems : 'center' , flex : 4 } } >
108+ {
109+ eligible !== 'indeterminate' && (
110+ < HBox >
111+ < EligibilityOverviewBanner t = { t } eligible = { eligible } />
112+ </ HBox >
113+ )
114+ }
115+ { ! isVisible && (
116+ < HBox sx = { { flexWrap : 'wrap' , gap : 1 } } >
117+ { item . benefitCategories ?. map ( tag => (
118+ < EligibilityOverviewTag
119+ key = { tag . id }
120+ tag = { tag . label }
121+ tagType = "benefitCategories"
122+ />
123+ ) ) }
107124 </ HBox >
108- )
109- }
110- { eligible === 'indeterminate' &&
125+ ) }
126+ </ HBox >
127+ < HBox sx = { { justifyContent : 'flex-end' , flexWrap : 'wrap' , gap : 2 , alignItems : 'center' , flex : 3 } } >
111128 < RegularButton
112- variant = { 'blueHollow' }
113- onClick = { ( ) => {
114- clearSelectedTopics ( )
115- setSelectedBenefits ( [ item . id ] ) ;
116- } }
117- text = { 'app.browseAll.checkElBtn' }
118- link = { `/onboarding-welcome` }
119- size = 'small'
120- endIcon = { < ChevronRightIcon sx = { { fontSize : '16px' } } /> }
129+ variant = { 'blackOutlined' }
130+ text = { 'app.browseAll.learnMoreBtn' }
131+ link = { `/benefit-page/${ item . id } ` }
121132 />
122-
123- }
124- < RegularButton
125- variant = { 'blackOutlined' }
126- text = { 'app.browseAll.learnMoreBtn' }
127- link = { `/benefit-page/${ item . id } ` }
128- size = 'small'
129- endIcon = { < ChevronRightIcon sx = { { fontSize : '16px' } } /> }
130- />
133+ { eligible === 'indeterminate' &&
134+ < RegularButton
135+ variant = { 'blueHollow' }
136+ onClick = { ( ) => {
137+ clearSelectedTopics ( )
138+ setSelectedBenefits ( [ item . id ] ) ;
139+ } }
140+ text = { 'app.browseAll.checkElBtn' }
141+ link = { `/onboarding-welcome` }
142+ endIcon = { < ChevronRightIcon sx = { { fontSize : '16px' } } /> }
143+ />
144+ }
145+ </ HBox >
131146 </ HBox >
132147 </ VBox >
133148 </ VBox >
0 commit comments