Skip to content

Commit

Permalink
Fix progress bar behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwiese committed Nov 9, 2023
1 parent 412f0ea commit 6f05116
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions products/statement-generator/src/components/FormHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ const FormHeader = () => {
formState: { involvement },
} = useContext(FormStateContext);

const isFrozen = currentStep === AppUrl.Involvement;

const stepNum = convertStepToNum(currentStep, involvement);
let maxNum = 6;

const {
isJobChecked,
isCommunityChecked,
Expand All @@ -128,8 +133,7 @@ const FormHeader = () => {
isSomethingElseChecked,
isUnemploymentChecked,
} = involvement;
let maxNum = 6;
const stepNum = convertStepToNum(currentStep, involvement);

if (isJobChecked) {
maxNum += 1;
}
Expand All @@ -152,11 +156,13 @@ const FormHeader = () => {
maxNum += 1;
}

if (currentStep === AppUrl.Involvement) {
maxNum = 6;
}
let percentageComplete;

const percentageComplete = (stepNum / maxNum) * 100;
if (isFrozen) {
percentageComplete = 20;
} else {
percentageComplete = (stepNum / maxNum) * 100;
}

const formTitle = getSectionTitle(currentStep);

Expand Down

0 comments on commit 6f05116

Please sign in to comment.