From 2874d6c9ba0d21e0b4ab3dae855de8653b94c138 Mon Sep 17 00:00:00 2001 From: stefano-lacorazza <112132737+stefano-lacorazza@users.noreply.github.com> Date: Thu, 26 Sep 2024 13:48:25 -0500 Subject: [PATCH] OV-369: + move MAX_PERCENT outside of the component --- frontend/src/bundles/common/components/stepper/stepper.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/src/bundles/common/components/stepper/stepper.tsx b/frontend/src/bundles/common/components/stepper/stepper.tsx index ae9160274..8dd8b9c5c 100644 --- a/frontend/src/bundles/common/components/stepper/stepper.tsx +++ b/frontend/src/bundles/common/components/stepper/stepper.tsx @@ -21,10 +21,11 @@ type Properties = { currentStep: string; onClickBack?: () => void; }; +const MAX_PERCENT = 100; const Stepper: React.FC = ({ steps, currentStep, onClickBack }) => { const activeStepIndex = steps.indexOf(currentStep); - const MAX_PERCENT = 100; + const progressPercent = (activeStepIndex / (steps.length - 1)) * MAX_PERCENT;