diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx new file mode 100644 index 0000000..848bacc --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,235 @@ +"use client"; + +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; +import { useState } from 'react'; +import { Mail, Lock, Eye, EyeOff, ArrowRight } from 'lucide-react'; + +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 [isSubmitting, setIsSubmitting] = useState(false); + + const validateForm = () => { + const newErrors: { email?: string; password?: string } = {}; + + if (!email) { + newErrors.email = 'Email is required'; + } else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email)) { + newErrors.email = 'Please enter a valid email'; + } + + if (!password) { + newErrors.password = 'Password is required'; + } else if (password.length < 6) { + newErrors.password = 'Password must be at least 6 characters'; + } + + setErrors(newErrors); + return Object.keys(newErrors).length === 0; + }; + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + if (!validateForm()) { + return; + } + + setIsSubmitting(true); + try { + // Simulated API call + await new Promise(resolve => setTimeout(resolve, 1000)); + console.log('Login attempt:', { email, password }); + // In a real app, you would redirect to dashboard or handle authentication + } finally { + setIsSubmitting(false); + } + }; + + return ( + + + +
+
+
+ {/* Header */} +
+

+ Welcome Back +

+

+ Sign in to your FitFlow Pro account +

+
+ + {/* Form */} +
+ {/* Email Field */} +
+ +
+ + setEmail(e.target.value)} + placeholder="you@example.com" + className="w-full pl-10 pr-4 py-2.5 rounded-lg border transition-all" + style={{ + backgroundColor: 'var(--color-background)', + borderColor: errors.email ? '#ef4444' : 'var(--color-primary-cta)', + color: 'var(--color-foreground)', + }} + /> +
+ {errors.email && ( +

+ {errors.email} +

+ )} +
+ + {/* Password Field */} +
+ +
+ + setPassword(e.target.value)} + placeholder="••••••••" + className="w-full pl-10 pr-10 py-2.5 rounded-lg border transition-all" + style={{ + backgroundColor: 'var(--color-background)', + borderColor: errors.password ? '#ef4444' : 'var(--color-primary-cta)', + color: 'var(--color-foreground)', + }} + /> + +
+ {errors.password && ( +

+ {errors.password} +

+ )} +
+ + {/* Remember & Forgot */} +
+ + + Forgot password? + +
+ + {/* Submit Button */} + +
+ + {/* Divider */} +
+
+ OR +
+
+ + {/* Social Login */} +
+ + +
+ + {/* Sign Up Link */} +

+ Don't have an account?{' '} + + Sign up + +

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