From 55a6873a139deda36fb7cf9e9efbf7b7700525de Mon Sep 17 00:00:00 2001 From: bender Date: Sat, 21 Mar 2026 15:21:39 +0000 Subject: [PATCH] Add src/app/login/page.tsx --- src/app/login/page.tsx | 283 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 283 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..f05c197 --- /dev/null +++ b/src/app/login/page.tsx @@ -0,0 +1,283 @@ +"use client"; + +import { useState } from "react"; +import Link from "next/link"; +import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; +import NavbarStyleFullscreen from "@/components/navbar/NavbarStyleFullscreen/NavbarStyleFullscreen"; +import FooterLogoEmphasis from "@/components/sections/footer/FooterLogoEmphasis"; +import { Lock, Mail, AlertCircle, CheckCircle } from "lucide-react"; + +export default function LoginPage() { + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [errors, setErrors] = useState<{ email?: string; password?: string }>({}); + const [isLoading, setIsLoading] = useState(false); + const [submitStatus, setSubmitStatus] = useState<"success" | "error" | null>(null); + + const navItems = [ + { name: "Dashboard", id: "dashboard" }, + { name: "How It Works", id: "how-it-works" }, + { name: "Features", id: "features" }, + { name: "Support", id: "support" }, + ]; + + const footerColumns = [ + { + items: [ + { label: "Dashboard", href: "/dashboard" }, + { label: "How It Works", href: "#how-it-works" }, + { label: "Features", href: "#features" }, + { label: "Support", href: "/support" }, + ], + }, + { + items: [ + { label: "About Us", href: "#" }, + { label: "Our Team", href: "#" }, + { label: "Blog", href: "#" }, + { label: "Careers", href: "#" }, + ], + }, + { + items: [ + { label: "Privacy Policy", href: "#" }, + { label: "Terms of Service", href: "#" }, + { label: "Security", href: "#" }, + { label: "Compliance", href: "#" }, + ], + }, + { + items: [ + { label: "Email", href: "mailto:support@financeflow.com" }, + { label: "Phone", href: "tel:+919876543210" }, + { label: "Twitter", href: "https://twitter.com" }, + { label: "LinkedIn", href: "https://linkedin.com" }, + ], + }, + ]; + + 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 address"; + } + + 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(); + setSubmitStatus(null); + + if (!validateForm()) { + setSubmitStatus("error"); + return; + } + + setIsLoading(true); + try { + // Simulate API call + await new Promise((resolve) => setTimeout(resolve, 1500)); + setSubmitStatus("success"); + setEmail(""); + setPassword(""); + setErrors({}); + // In a real app, redirect to dashboard + } catch (error) { + setSubmitStatus("error"); + } finally { + setIsLoading(false); + } + }; + + return ( + + + +
+
+
+ {/* Header */} +
+
+ +
+

+ Welcome Back +

+

+ Sign in to your FinanceFlow account +

+
+ + {/* Status Messages */} + {submitStatus === "success" && ( +
+ +
+

+ Login successful! +

+

+ Redirecting to your dashboard... +

+
+
+ )} + + {submitStatus === "error" && Object.keys(errors).length > 0 && ( +
+ +
+

+ Please fix the errors below +

+
+
+ )} + + {/* Form */} +
+ {/* Email Field */} +
+ +
+ + { + setEmail(e.target.value); + if (errors.email) setErrors({ ...errors, email: undefined }); + }} + placeholder="you@example.com" + className={`w-full pl-10 pr-4 py-2 rounded-lg border transition-colors ${ + errors.email + ? "border-red-300 bg-red-50 dark:bg-red-900/20 dark:border-red-700" + : "border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800" + } text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400`} + disabled={isLoading} + /> +
+ {errors.email && ( +

{errors.email}

+ )} +
+ + {/* Password Field */} +
+
+ + + Forgot? + +
+
+ + { + setPassword(e.target.value); + if (errors.password) setErrors({ ...errors, password: undefined }); + }} + placeholder="••••••••" + className={`w-full pl-10 pr-4 py-2 rounded-lg border transition-colors ${ + errors.password + ? "border-red-300 bg-red-50 dark:bg-red-900/20 dark:border-red-700" + : "border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800" + } text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400`} + disabled={isLoading} + /> +
+ {errors.password && ( +

{errors.password}

+ )} +
+ + {/* Submit Button */} + +
+ + {/* Divider */} +
+
+ or +
+
+ + {/* Sign Up Link */} +

+ Don't have an account?{" "} + + Create one now + +

+
+ + {/* Additional Info */} +

+ Your data is secure and protected by industry-leading encryption +

+
+
+ + +
+ ); +}