diff --git a/client/pages/Onboarding.tsx b/client/pages/Onboarding.tsx index 969f0880..df880e2b 100644 --- a/client/pages/Onboarding.tsx +++ b/client/pages/Onboarding.tsx @@ -51,6 +51,8 @@ const initialData: OnboardingData = { export default function Onboarding() { const [currentStep, setCurrentStep] = useState(0); const [data, setData] = useState(initialData); + const [isLoading, setIsLoading] = useState(true); + const [isTransitioning, setIsTransitioning] = useState(false); const steps = [ { title: "Choose Your Path", component: UserTypeSelection }, @@ -60,24 +62,44 @@ export default function Onboarding() { { title: "Welcome to AeThex", component: Welcome }, ]; + useEffect(() => { + const timer = setTimeout(() => { + setIsLoading(false); + }, 1200); + + return () => clearTimeout(timer); + }, []); + const updateData = (newData: Partial) => { setData(prev => ({ ...prev, ...newData })); }; const nextStep = () => { if (currentStep < steps.length - 1) { - setCurrentStep(prev => prev + 1); + setIsTransitioning(true); + setTimeout(() => { + setCurrentStep(prev => prev + 1); + setIsTransitioning(false); + }, 300); } }; const prevStep = () => { if (currentStep > 0) { - setCurrentStep(prev => prev - 1); + setIsTransitioning(true); + setTimeout(() => { + setCurrentStep(prev => prev - 1); + setIsTransitioning(false); + }, 300); } }; const CurrentStepComponent = steps[currentStep].component; + if (isLoading) { + return ; + } + return (