From 6f051163efb21a9d1bae98b4f21115b10a6a8c07 Mon Sep 17 00:00:00 2001 From: David Wiese <21321101+davidwiese@users.noreply.github.com> Date: Thu, 9 Nov 2023 14:41:19 -0800 Subject: [PATCH] Fix progress bar behavior --- .../src/components/FormHeader.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/products/statement-generator/src/components/FormHeader.tsx b/products/statement-generator/src/components/FormHeader.tsx index 52c4bb03..f1f436be 100644 --- a/products/statement-generator/src/components/FormHeader.tsx +++ b/products/statement-generator/src/components/FormHeader.tsx @@ -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, @@ -128,8 +133,7 @@ const FormHeader = () => { isSomethingElseChecked, isUnemploymentChecked, } = involvement; - let maxNum = 6; - const stepNum = convertStepToNum(currentStep, involvement); + if (isJobChecked) { maxNum += 1; } @@ -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);