Skip to content

Commit

Permalink
fix sections logic
Browse files Browse the repository at this point in the history
  • Loading branch information
wbglaeser committed Jun 7, 2024
1 parent 99f2bda commit 34c049b
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 13 deletions.
3 changes: 2 additions & 1 deletion public/assets/data/profile-sections/children.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"title": "Job",
"id": "children",
"title": "Children",
"fields": [
{
"datafield": "ff:hasBirthday",
Expand Down
3 changes: 2 additions & 1 deletion public/assets/data/profile-sections/education.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"title": "Job",
"id": "education",
"title": "Education",
"fields": [
{
"datafield": "ff:hasBirthday",
Expand Down
3 changes: 2 additions & 1 deletion public/assets/data/profile-sections/income.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"title": "Job",
"id": "income",
"title": "Income",
"fields": [
{
"datafield": "ff:hasBirthday",
Expand Down
1 change: 1 addition & 0 deletions public/assets/data/profile-sections/job.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"id": "job",
"title": "Job",
"fields": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Link } from "react-router-dom";
import VStack from "../../../components/VStack";
import HStack from "../../../components/HStack";

const OnboardingSectionsItem = ({section, entityData, active, completed, first}) => {
const OnboardingSectionsItem = ({section, entityData, active, completed}) => {
const backgroundColor = active ? yellow[600] : (completed ? green[500] : 'rgba(0, 0, 0, 0.1)')

return (
Expand All @@ -29,7 +29,6 @@ const OnboardingSectionsItem = ({section, entityData, active, completed, first})
state={{ entityData }}
>
<HStack alignItems={'center'} gap={1}>
{first ? <Typography>Start</Typography> : null}
<ArrowForwardIosOutlinedIcon/>
</HStack>
</ButtonBase>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ const OnboardingSectionsList = ({onboardingSectionsData}) => {
const sections = useProfileInputSectionStore((state) => state.sections);
//const allCompleted = sections.every((obj) => obj.completed);

console.log('sections:', sections);
console.log('activeSection:', activeSection);

return (
<VStack gap={3} sx={{width: 'inherit'}}>
<VStack gap={2}>
Expand All @@ -31,8 +28,7 @@ const OnboardingSectionsList = ({onboardingSectionsData}) => {
section={section}
entityData={entityData}
active={section.id === activeSection}
completed={sectionStatus.completed}
first={index === 0}/>
completed={sectionStatus.completed}/>
)
})}
</VStack>
Expand Down
2 changes: 1 addition & 1 deletion src/screens/profile-section/ProfileSectionScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const ProfileSectionScreen = () => {
{!completed ?
(<ProfileSectionList profileSectionData={profileSectionData} entityData={entityData}
setCompleted={setCompleted}/>)
: (<ProfileSectionCompleted id={id}/>)
: (<ProfileSectionCompleted title={profileSectionData.title} id={id}/>)
}
</>)
:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Button, Card, CardContent, Typography} from "@mui/material";
import {green, yellow} from "@mui/material/colors";
import SentimentSatisfiedOutlinedIcon from "@mui/icons-material/SentimentSatisfiedOutlined";

const ProfileSectionCompleted = ({id}) => {
const ProfileSectionCompleted = ({title, id}) => {
const sectionStatus = useProfileInputSectionStore(
(state) => state.sections
);
Expand All @@ -22,7 +22,7 @@ const ProfileSectionCompleted = ({id}) => {
<ProfileCompletedPieChart completedSections={completedSections} totalSections={sectionStatus.length}/>
<HStack justifyContent={'center'} sx={{width: "100%"}}>
<VStack gap={1} alignItems={'center'}>
<Typography variant="h4">About you</Typography>
<Typography variant="h4">{title}</Typography>
<Typography variant="h6">Profilbereich vollständig!</Typography>
</VStack>
</HStack>
Expand Down

0 comments on commit 34c049b

Please sign in to comment.