From 4e33aad76df0d902d489e490acccb67c7e336672 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 11 Mar 2026 19:55:31 +0000 Subject: [PATCH] Add src/app/login/page.tsx --- src/app/login/page.tsx | 259 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 259 insertions(+) create mode 100644 src/app/login/page.tsx diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..a63a45b --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,259 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; +import ContactCTA from '@/components/sections/contact/ContactCTA'; +import FooterLogoEmphasis from '@/components/sections/footer/FooterLogoEmphasis'; +import { Mail, Lock, ArrowRight, AlertCircle } from 'lucide-react'; +import { useState } from 'react'; + +export default function LoginPage() { + const [formData, setFormData] = useState({ + email: '', + password: '' + }); + const [errors, setErrors] = useState<{ [key: string]: string }>({}); + const [isSubmitting, setIsSubmitting] = useState(false); + + const validateForm = () => { + const newErrors: { [key: string]: string } = {}; + + if (!formData.email) { + newErrors.email = 'Email é obrigatório'; + } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(formData.email)) { + newErrors.email = 'Email inválido'; + } + + if (!formData.password) { + newErrors.password = 'Senha é obrigatória'; + } else if (formData.password.length < 6) { + newErrors.password = 'Senha deve ter pelo menos 6 caracteres'; + } + + setErrors(newErrors); + return Object.keys(newErrors).length === 0; + }; + + const handleChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setFormData(prev => ({ + ...prev, + [name]: value + })); + if (errors[name]) { + setErrors(prev => ({ + ...prev, + [name]: '' + })); + } + }; + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + if (!validateForm()) { + return; + } + + setIsSubmitting(true); + try { + await new Promise(resolve => setTimeout(resolve, 1000)); + console.log('Login attempt:', formData); + alert('Login bem-sucedido!'); + setFormData({ email: '', password: '' }); + } catch (error) { + setErrors({ submit: 'Erro ao fazer login. Tente novamente.' }); + } finally { + setIsSubmitting(false); + } + }; + + return ( + + + +
+
+
+

Bem-vindo de volta

+

Faça login na sua conta FitFlow Pro

+
+ +
+
+ {/* Email Field */} +
+ +
+ + +
+ {errors.email && ( +
+ + {errors.email} +
+ )} +
+ + {/* Password Field */} +
+ +
+ + +
+ {errors.password && ( +
+ + {errors.password} +
+ )} +
+ + {/* Submit Errors */} + {errors.submit && ( +
+ + {errors.submit} +
+ )} + + {/* Submit Button */} + +
+ + {/* Divider */} +
+
+
+
+
+ ou continue com +
+
+ + {/* Social Login Buttons */} +
+ + +
+
+ + {/* Sign Up Link */} +

+ Não tem conta?{' '} + + Criar conta + +

+ + {/* Forgot Password Link */} +

+ + Esqueceu sua senha? + +

+
+
+ + +
+ ); +} \ No newline at end of file