diff --git a/frontend/public/ping.png b/frontend/public/ping.png new file mode 100644 index 0000000..2c34a7f Binary files /dev/null and b/frontend/public/ping.png differ diff --git a/frontend/src/pages/Login.jsx b/frontend/src/pages/Login.jsx index 3af2e66..981f2dd 100644 --- a/frontend/src/pages/Login.jsx +++ b/frontend/src/pages/Login.jsx @@ -1,146 +1,152 @@ -/** - * Login Page - * - * Allows existing users to sign in with email and password - */ - import { useState } from "react"; import { Link, useNavigate } from "react-router-dom"; import { useAuth } from "../contexts/AuthContext"; export default function Login() { - const [email, setEmail] = useState(""); - const [password, setPassword] = useState(""); - const [error, setError] = useState(""); - const [loading, setLoading] = useState(false); + const [email, setEmail] = useState(""); + const [password, setPassword] = useState(""); + const [error, setError] = useState(""); + const [loading, setLoading] = useState(false); - const { login } = useAuth(); - const navigate = useNavigate(); + const { login } = useAuth(); + const navigate = useNavigate(); - async function handleSubmit(e) { - e.preventDefault(); + async function handleSubmit(e) { + e.preventDefault(); - // Validation - if (!email || !password) { - setError("Please fill in all fields"); - return; - } - - try { - setError(""); - setLoading(true); - await login(email, password); - navigate("/addresses"); // Redirect to main app - } catch (err) { - setError("Failed to log in: " + err.message); - } finally { - setLoading(false); - } + // Validation + if (!email || !password) { + setError("Please fill in all fields"); + return; } - return ( + try { + setError(""); + setLoading(true); + await login(email, password); + navigate("/addresses"); // Redirect to main app + } catch (err) { + setError("Failed to log in: " + err.message); + } finally { + setLoading(false); + } + } + + return ( +
+
+

+ Koin Ping - Login +

+ + {error && (
-

- Koin Ping - Login -

- - {error && ( -
- {error} -
- )} - -
-
- - setEmail(e.target.value)} - disabled={loading} - style={{ - width: "100%", - padding: "0.5rem", - fontSize: "1rem", - backgroundColor: "#242424", - border: "1px solid #444", - borderRadius: "4px", - color: "white", - }} - required - /> -
- -
- - setPassword(e.target.value)} - disabled={loading} - style={{ - width: "100%", - padding: "0.5rem", - fontSize: "1rem", - backgroundColor: "#242424", - border: "1px solid #444", - borderRadius: "4px", - color: "white", - }} - required - /> -
- - -
- -
-

- Don't have an account?{" "} - - Sign up here - -

-
+ {error}
- ); + )} + +
+
+ + setEmail(e.target.value)} + disabled={loading} + style={{ + width: "100%", + padding: "0.5rem", + fontSize: "1.2rem", + backgroundColor: "#242424", + border: "1px solid #444", + borderRadius: "4px", + color: "white", + }} + required + /> +
+ +
+ + setPassword(e.target.value)} + disabled={loading} + style={{ + width: "100%", + padding: "0.5rem", + fontSize: "1.2rem", + backgroundColor: "#242424", + border: "1px solid #444", + borderRadius: "4px", + color: "white", + }} + required + /> +
+ + +
+ +
+

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

+
+
+
+ ); }