Skip to content

Commit

Permalink
make profile section button conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
wbglaeser committed Jun 6, 2024
1 parent 6c187c8 commit e988b28
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ButtonBase from "@mui/material/ButtonBase";
import {yellow} from '@mui/material/colors';


const onboardingSectionsItem = ({section, active}) => {
const onboardingSectionsItem = ({section, active, first}) => {
const backgroundColor = active ? yellow[500] : 'rgba(0, 0, 0, 0.1)'

return (
Expand All @@ -23,9 +23,16 @@ const onboardingSectionsItem = ({section, active}) => {
</Card>
<Typography sx={styles.sectionTitle}>{section.title}</Typography>
</HStack>
<ButtonBase component={Link} to="/onboarding">
<ArrowForwardIosOutlinedIcon/>
</ButtonBase>
{
active ? (
<ButtonBase component={Link} to="/onboarding">
<HStack alignItems={'center'}>
{first ? <Typography>Start</Typography> : null}
<ArrowForwardIosOutlinedIcon/>
</HStack>
</ButtonBase>
) : null
}
</HStack>
</VStack>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ const OnboardingSectionsList = ({onboardingSectionsData}) => {
Profilbereiche
</Typography>
</VStack>
{onboardingSectionsData.personalisedData.map((section) => (
<OnboardingSectionsItem key={section.id} section={section} active={section.id === activeSection}/>
))}
{onboardingSectionsData.personalisedData.map((section, index) => (
<OnboardingSectionsItem key={section.id} section={section} active={section.id === activeSection}
first={index === 0}/>
))}
</VStack>
);
}
Expand Down

0 comments on commit e988b28

Please sign in to comment.