diff --git a/frontend/src/ForgotPassword.tsx b/frontend/src/ForgotPassword.tsx new file mode 100644 index 0000000..799102f --- /dev/null +++ b/frontend/src/ForgotPassword.tsx @@ -0,0 +1,100 @@ +import React, { useState } from "react"; +import { useNavigate } from "react-router-dom"; +import logo from "./images/logo.svg"; + +/** + * Forgot Password page - allows users to request a password reset email + */ +const ForgotPassword = () => { + const [email, setEmail] = useState(""); + const [submitted, setSubmitted] = useState(false); + const navigate = useNavigate(); + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + // TODO: Add API call to backend when endpoint is ready + // For now, just show success message + console.log("Password reset requested for:", email); + setSubmitted(true); + }; + + return ( +
+ {/* Left side: Forgot Password form */} +
+
+

Forgot Password

+
+ + {!submitted ? ( +
+ {/* Email Input */} +
+ + setEmail(e.target.value)} + placeholder="Enter your email address" + className="w-full rounded-xl border border-grey-600 bg-white py-3 px-4 text-base text-black placeholder:text-grey-600 focus:outline-none focus:ring-2 focus:ring-primary-900 focus:border-transparent" + /> +
+ + {/* Send Email Button */} + + + {/* Back to Login Link */} +
+ Remembered your password?{" "} + +
+
+ ) : ( + // Success message after submission +
+
+ If an account exists with this email, you'll receive password reset instructions. +
+ +
+ )} +
+ + {/* Right side: Logo */} +
+
+ BCAN Logo +
+
+
+ ); +}; + +export default ForgotPassword; \ No newline at end of file diff --git a/frontend/src/Login.tsx b/frontend/src/Login.tsx index 6a85663..77f9b74 100644 --- a/frontend/src/Login.tsx +++ b/frontend/src/Login.tsx @@ -11,6 +11,8 @@ import "./external/bcanSatchel/mutators"; const Login = observer(() => { const [username, setUsername] = useState(""); const [password, setPassword] = useState(""); + const [rememberMe, setRememberMe] = useState(false); + const [showPassword, setShowPassword] = useState(false); const [failure, setFailure] = useState(false); const navigate = useNavigate(); const { login } = useAuthContext(); @@ -21,97 +23,127 @@ const Login = observer(() => { const success = await login(username, password); if (success) { - navigate("/grant-info"); + navigate("/main/all-grants"); } else { setFailure(true); } }; return ( -
+
{/*/ Left side: Registration form */} -
-
-

Welcome back!

-

- Enter your credentials to access your account. -

+
+
+

Log in

-
-