diff --git a/frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx b/frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx index 019dd7f43..c96136ce1 100644 --- a/frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx +++ b/frontend/src/components/OnboardingSteps/AvatarSelectionStep.tsx @@ -22,11 +22,13 @@ import { AppFeatures } from '@/components/OnboardingSteps/AppFeatures'; interface AvatarNameSelectionStepProps { stepIndex: number; totalSteps: number; + currentStepDisplayIndex: number; } export const AvatarSelectionStep: React.FC = ({ stepIndex, totalSteps, + currentStepDisplayIndex, }) => { const dispatch = useDispatch(); @@ -65,14 +67,18 @@ export const AvatarSelectionStep: React.FC = ({
- Step {stepIndex + 1} of {totalSteps} + Step {currentStepDisplayIndex + 1} of {totalSteps} + + + {Math.round(((currentStepDisplayIndex + 1) / totalSteps) * 100)}% - {Math.round(((stepIndex + 1) / totalSteps) * 100)}%
diff --git a/frontend/src/components/OnboardingSteps/FolderSetupStep.tsx b/frontend/src/components/OnboardingSteps/FolderSetupStep.tsx index e76c1079a..13a944413 100644 --- a/frontend/src/components/OnboardingSteps/FolderSetupStep.tsx +++ b/frontend/src/components/OnboardingSteps/FolderSetupStep.tsx @@ -19,11 +19,13 @@ import { useEffect, useState } from 'react'; interface FolderSetupStepProps { stepIndex: number; totalSteps: number; + currentStepDisplayIndex: number; } export function FolderSetupStep({ stepIndex, totalSteps, + currentStepDisplayIndex, }: FolderSetupStepProps) { const dispatch = useDispatch(); @@ -64,7 +66,9 @@ export function FolderSetupStep({ if (localStorage.getItem('folderChosen') === 'true') { return null; } - const progressPercent = Math.round(((stepIndex + 1) / totalSteps) * 100); + const progressPercent = Math.round( + ((currentStepDisplayIndex + 1) / totalSteps) * 100, + ); return ( <> @@ -72,7 +76,7 @@ export function FolderSetupStep({
- Step {stepIndex + 1} of {totalSteps} + Step {currentStepDisplayIndex + 1} of {totalSteps} {progressPercent}%
diff --git a/frontend/src/components/OnboardingSteps/OnboardingStep.tsx b/frontend/src/components/OnboardingSteps/OnboardingStep.tsx index 07d53a01d..3dfd06f2b 100644 --- a/frontend/src/components/OnboardingSteps/OnboardingStep.tsx +++ b/frontend/src/components/OnboardingSteps/OnboardingStep.tsx @@ -23,9 +23,12 @@ export const OnboardingStep: React.FC = ({ stepIndex, stepName, }) => { + const visibleStepIndex = VISIBLE_STEPS.indexOf(stepName); + const sharedProps = { stepIndex, totalSteps: VISIBLE_STEPS.length, + currentStepDisplayIndex: visibleStepIndex, }; const renderStepComponent = () => { diff --git a/frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx b/frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx index 33e8bbd5f..c14108e01 100644 --- a/frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx +++ b/frontend/src/components/OnboardingSteps/ThemeSelectionStep.tsx @@ -21,11 +21,13 @@ import { useTheme } from '@/contexts/ThemeContext'; interface ThemeSelectionStepProps { stepIndex: number; totalSteps: number; + currentStepDisplayIndex: number; } export const ThemeSelectionStep: React.FC = ({ stepIndex, totalSteps, + currentStepDisplayIndex, }) => { const { setTheme, theme } = useTheme(); const dispatch = useDispatch(); @@ -51,14 +53,16 @@ export const ThemeSelectionStep: React.FC = ({ return null; } - const progressPercent = Math.round(((stepIndex + 1) / totalSteps) * 100); + const progressPercent = Math.round( + ((currentStepDisplayIndex + 1) / totalSteps) * 100, + ); return ( <>
- Step {stepIndex + 1} of {totalSteps} + Step {currentStepDisplayIndex + 1} of {totalSteps} {progressPercent}%