diff --git a/src/app/signup/page.tsx b/src/app/signup/page.tsx deleted file mode 100644 index f4a18db..0000000 --- a/src/app/signup/page.tsx +++ /dev/null @@ -1,273 +0,0 @@ -"use client"; - -import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; -import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; -import { useState } from "react"; -import { Eye, EyeOff, Mail, Lock, User, CheckCircle2, AlertCircle } from 'lucide-react'; -import Input from '@/components/form/Input'; - -export default function SignupPage() { - const [formData, setFormData] = useState({ - name: "", email: "", password: "", confirmPassword: "" - }); - const [showPassword, setShowPassword] = useState(false); - const [showConfirmPassword, setShowConfirmPassword] = useState(false); - const [errors, setErrors] = useState<{ [key: string]: string }>({}); - const [isSubmitted, setIsSubmitted] = useState(false); - const [passwordStrength, setPasswordStrength] = useState<"weak" | "medium" | "strong" | "">(""); - - const calculatePasswordStrength = (pwd: string): "weak" | "medium" | "strong" | "" => { - if (!pwd) return ""; - if (pwd.length < 8) return "weak"; - if (/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{8}$/.test(pwd)) return "strong"; - return "medium"; - }; - - const handleInputChange = (field: string, value: string) => { - setFormData(prev => ({ - ...prev, - [field]: value - })); - - if (field === "password") { - setPasswordStrength(calculatePasswordStrength(value)); - } - }; - - const validateForm = () => { - const newErrors: { [key: string]: string } = {}; - - if (!formData.name.trim()) { - newErrors.name = "Nome é obrigatório"; - } else if (formData.name.trim().length < 2) { - newErrors.name = "Nome deve ter no mínimo 2 caracteres"; - } - - 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 < 8) { - newErrors.password = "Senha deve ter no mínimo 8 caracteres"; - } - - if (formData.password !== formData.confirmPassword) { - newErrors.confirmPassword = "As senhas não correspondem"; - } - - return newErrors; - }; - - const handleSubmit = (e: React.FormEvent) => { - e.preventDefault(); - const newErrors = validateForm(); - setErrors(newErrors); - - if (Object.keys(newErrors).length === 0) { - setIsSubmitted(true); - console.log("Signup attempt:", formData); - setTimeout(() => { - setIsSubmitted(false); - }, 2000); - } - }; - - const getStrengthColor = () => { - switch (passwordStrength) { - case "weak": - return "text-red-500"; - case "medium": - return "text-yellow-500"; - case "strong": - return "text-green-500"; - default: - return "text-foreground/30"; - } - }; - - return ( - - - -
-
-
-
-

Começar Agora

-

Crie sua conta e inicie sua transformação

-
- -
-
- - handleInputChange("name", value)} - type="text" - placeholder="Seu nome" - required - className={errors.name ? "border-red-500" : ""} - /> - {errors.name && ( -
- - {errors.name} -
- )} -
- -
- - handleInputChange("email", value)} - type="email" - placeholder="seu@email.com" - required - className={errors.email ? "border-red-500" : ""} - /> - {errors.email && ( -
- - {errors.email} -
- )} -
- -
- -
- handleInputChange("password", value)} - type={showPassword ? "text" : "password"} - placeholder="••••••••" - required - className={errors.password ? "border-red-500" : "pr-10"} - /> - -
- {passwordStrength && ( -
- - Força: {passwordStrength === "weak" ? "Fraca" : passwordStrength === "medium" ? "Média" : "Forte"} -
- )} - {errors.password && ( -
- - {errors.password} -
- )} -
- -
- -
- handleInputChange("confirmPassword", value)} - type={showConfirmPassword ? "text" : "password"} - placeholder="••••••••" - required - className={errors.confirmPassword ? "border-red-500" : "pr-10"} - /> - -
- {errors.confirmPassword && ( -
- - {errors.confirmPassword} -
- )} -
- - -
- -
-

- Já tem conta?{" "} - - Fazer login - -

-
- -
-

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

-

Ao criar uma conta, você concorda com nossos Termos de Serviço e Política de Privacidade.

-
-
-
-
-
- ); -}