diff --git a/src/app/onboarding/page.tsx b/src/app/onboarding/page.tsx new file mode 100644 index 0000000..c601675 --- /dev/null +++ b/src/app/onboarding/page.tsx @@ -0,0 +1,332 @@ +"use client"; + +import { useState } from "react"; +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; +import FooterBase from '@/components/sections/footer/FooterBase'; +import { ChevronRight, User, Users } from 'lucide-react'; + +interface UserProfile { + name: string; + gender: string; + height: string; + weight: string; + age: string; +} + +type OnboardingStep = 'basic' | 'biometric' | 'complete'; + +export default function OnboardingPage() { + const [step, setStep] = useState('basic'); + const [profile, setProfile] = useState({ + name: '', + gender: '', + height: '', + weight: '', + age: '' + }); + + const handleBasicChange = (field: keyof Pick, value: string) => { + setProfile(prev => ({ ...prev, [field]: value })); + }; + + const handleBiometricChange = (field: keyof Pick, value: string) => { + setProfile(prev => ({ ...prev, [field]: value })); + }; + + const handleBasicSubmit = (e: React.FormEvent) => { + e.preventDefault(); + if (profile.name && profile.gender) { + setStep('biometric'); + } + }; + + const handleBiometricSubmit = (e: React.FormEvent) => { + e.preventDefault(); + if (profile.height && profile.weight && profile.age) { + saveProfile(); + setStep('complete'); + } + }; + + const saveProfile = () => { + localStorage.setItem('userProfile', JSON.stringify(profile)); + console.log('Profile saved:', profile); + }; + + const handleReset = () => { + setProfile({ name: '', gender: '', height: '', weight: '', age: '' }); + setStep('basic'); + }; + + return ( + + + +
+
+ {/* Progress Indicator */} +
+
+
+
1
+ Dados Pessoais +
+
+
+
2
+ Biometria +
+
+
+ + {/* Step 1: Basic Information */} + {step === 'basic' && ( +
+
+

Vamos Começar!

+

Primeiro, precisamos conhecer você melhor.

+
+ +
+ {/* Name Input */} +
+ + handleBasicChange('name', e.target.value)} + placeholder="Digite seu nome" + className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition" + required + /> +
+ + {/* Gender Selection */} +
+ +
+ {['Masculino', 'Feminino'].map((gender) => ( + + ))} +
+
+ + {/* Submit Button */} + +
+
+ )} + + {/* Step 2: Biometric Information */} + {step === 'biometric' && ( +
+
+

Dados Biométricos

+

Agora, alguns dados de biometria para personalizar seu treino.

+
+ +
+ {/* Height Input */} +
+ + handleBiometricChange('height', e.target.value)} + placeholder="Ex: 175" + className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition" + required + /> +
+ + {/* Weight Input */} +
+ + handleBiometricChange('weight', e.target.value)} + placeholder="Ex: 75" + step="0.1" + className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition" + required + /> +
+ + {/* Age Input */} +
+ + handleBiometricChange('age', e.target.value)} + placeholder="Ex: 28" + className="w-full px-4 py-3 rounded-lg border-2 border-gray-200 focus:border-primary-cta focus:outline-none transition" + required + /> +
+ + {/* Buttons */} +
+ + +
+
+
+ )} + + {/* Step 3: Completion */} + {step === 'complete' && ( +
+
+
+ +
+

Perfil Criado com Sucesso!

+

Bem-vindo ao FitFlow Pro, {profile.name}!

+ + {/* Profile Summary */} +
+
+ Nome: + {profile.name} +
+
+ Gênero: + {profile.gender} +
+
+ Altura: + {profile.height} cm +
+
+ Peso: + {profile.weight} kg +
+
+ Idade: + {profile.age} anos +
+
+
+ + {/* Action Buttons */} +
+ + + Ir para Dashboard + +
+
+ )} +
+
+ + +
+ ); +} \ No newline at end of file