diff --git a/apps/oneclient/frontend/src/components/Stepper.tsx b/apps/oneclient/frontend/src/components/Stepper.tsx index 2a2d6850..b941e42f 100644 --- a/apps/oneclient/frontend/src/components/Stepper.tsx +++ b/apps/oneclient/frontend/src/components/Stepper.tsx @@ -3,16 +3,17 @@ import { useMatchRoute } from '@tanstack/react-router'; interface VerticalStepperProps { steps: Array; + currentLinearIndex: number; linearSteps: Array>; }; -export function Stepper({ steps, linearSteps }: VerticalStepperProps) { - const matchRoute = useMatchRoute(); +export function Stepper({ steps, linearSteps, currentLinearIndex }: VerticalStepperProps) { + // const matchRoute = useMatchRoute(); - const currentLinearIndex = linearSteps.findIndex(step => - matchRoute({ to: step.path })); + // const currentLinearIndex = linearSteps.findIndex(step => + // matchRoute({ to: step.path })); - const progressHeight = currentLinearIndex >= 0 ? `${(currentLinearIndex / (linearSteps.length - 1)) * 100}%` : '0%'; + const progressHeight = currentLinearIndex >= 0 ? `${Math.min((currentLinearIndex + 0.5) / (linearSteps.length - 1), 1) * 100}%` : '0%'; // const nextStep = () => { // if (currentStep < steps.length - 1) @@ -50,15 +51,17 @@ export function Stepper({ steps, linearSteps }: VerticalStepperProps) { // onClick={() => goToStep(index)} >
- {step.title} diff --git a/apps/oneclient/frontend/src/routes/onboarding/route.tsx b/apps/oneclient/frontend/src/routes/onboarding/route.tsx index 4c4046cc..64df01c9 100644 --- a/apps/oneclient/frontend/src/routes/onboarding/route.tsx +++ b/apps/oneclient/frontend/src/routes/onboarding/route.tsx @@ -84,23 +84,25 @@ const LINEAR_ONBOARDING_STEPS = getLinearSteps(ONBOARDING_STEPS); function RouteComponent() { return ( - - -
+ // + +
+ -
-
-
+ +
+
+ //
); } function AppShell({ children, }: PropsWithChildren) { - const { isFirstStep } = Route.useLoaderData(); + const { isFirstStep, currentStepIndex } = Route.useLoaderData(); return (
@@ -115,7 +117,7 @@ function AppShell({