Skip to content

Commit

Permalink
Merge pull request #1070 from hackforla/945-progress-bar-bug
Browse files Browse the repository at this point in the history
945 Fix progress bar behavior
  • Loading branch information
sydneywalcoff authored Nov 9, 2023
2 parents d7a136f + 6f05116 commit 5d1ebe2
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 5d1ebe2

Please sign in to comment.