From cf7f68eb93c5f94873a0d8941fd8fca71ae63160 Mon Sep 17 00:00:00 2001 From: jyswee Date: Thu, 23 Jul 2026 22:08:27 +0000 Subject: [PATCH] Seed: saas template (34 files) --- src/pages/ForgotPassword.tsx | 107 +++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 src/pages/ForgotPassword.tsx diff --git a/src/pages/ForgotPassword.tsx b/src/pages/ForgotPassword.tsx new file mode 100644 index 0000000..493142a --- /dev/null +++ b/src/pages/ForgotPassword.tsx @@ -0,0 +1,107 @@ +import { useState } from "react"; +import { toast } from "sonner"; +import { Link } from "react-router-dom"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Layers, ArrowLeft, Mail, CheckCircle2, KeyRound } from "lucide-react"; + +export default function ForgotPasswordPage() { + const [email, setEmail] = useState(""); + const [sent, setSent] = useState(false); + const [code, setCode] = useState(""); + const [newPassword, setNewPassword] = useState(""); + const [step, setStep] = useState<"email" | "code" | "done">("email"); + + const handleSendCode = (e: React.FormEvent) => { + e.preventDefault(); + setSent(true); + toast.success("Reset code sent to " + email); + setStep("code"); + }; + + const handleResetPassword = (e: React.FormEvent) => { + e.preventDefault(); + toast.success("Password reset successfully!"); + setStep("done"); + }; + + return ( +
+
+ +
+ +
+ Nexus + + + + + {step === "email" && ( + <> +
+
+ +
+

Forgot password?

+

No worries, we'll send you a reset code

+
+
+
+ + setEmail(e.target.value)} className="mt-1.5 bg-slate-800/50 border-slate-700 text-white placeholder:text-slate-500 focus:border-indigo-500" /> +
+ +
+ + )} + + {step === "code" && ( + <> +
+
+ +
+

Enter reset code

+

Check your email for a 6-digit code

+
+
+
+ + setCode(e.target.value)} className="mt-1.5 bg-slate-800/50 border-slate-700 text-white text-center text-2xl tracking-[0.5em] placeholder:text-slate-500 placeholder:tracking-[0.5em] focus:border-indigo-500" /> +
+
+ + setNewPassword(e.target.value)} className="mt-1.5 bg-slate-800/50 border-slate-700 text-white placeholder:text-slate-500 focus:border-indigo-500" /> +
+ +
+ + )} + + {step === "done" && ( +
+
+ +
+

Password reset!

+

Your password has been reset successfully

+ + + +
+ )} + +
+ + Back to sign in + +
+
+
+
+
+ ); +}