From ae2e08a15d30b3edefd524650ae899fec990c4f1 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 11 Mar 2026 19:46:32 +0000 Subject: [PATCH] Add src/app/login/page.tsx --- src/app/login/page.tsx | 160 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 160 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..7a1bd0a --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,160 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; +import { useState } from "react"; +import { Eye, EyeOff, Mail, Lock } from 'lucide-react'; +import Input from '@/components/form/Input'; + +export default function LoginPage() { + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [showPassword, setShowPassword] = useState(false); + const [errors, setErrors] = useState<{ email?: string; password?: string }>({}); + const [isSubmitted, setIsSubmitted] = useState(false); + + const validateForm = () => { + const newErrors: { email?: string; password?: string } = {}; + + if (!email) { + newErrors.email = "Email é obrigatório"; + } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { + newErrors.email = "Email inválido"; + } + + if (!password) { + newErrors.password = "Senha é obrigatória"; + } else if (password.length < 6) { + newErrors.password = "Senha deve ter no mínimo 6 caracteres"; + } + + return newErrors; + }; + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + const newErrors = validateForm(); + setErrors(newErrors); + + if (Object.keys(newErrors).length === 0) { + setIsSubmitted(true); + console.log("Login attempt:", { email, password }); + setTimeout(() => { + setIsSubmitted(false); + }, 2000); + } + }; + + return ( + + + +
+
+
+
+

Bem-vindo de Volta

+

Faça login para acessar seu progresso

+
+ +
+
+ + + {errors.email && ( +

{errors.email}

+ )} +
+ +
+ +
+ + +
+ {errors.password && ( +

{errors.password}

+ )} +
+ + +
+ +
+

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

+
+ +
+

Teste gratuito por 30 dias. Sem cartão de crédito necessário.

+
+
+
+
+
+ ); +}