diff --git a/frontend/src/components/PasswordInput.jsx b/frontend/src/components/PasswordInput.jsx
index bfeaeeb..99e5cb3 100644
--- a/frontend/src/components/PasswordInput.jsx
+++ b/frontend/src/components/PasswordInput.jsx
@@ -15,19 +15,24 @@ const EyeSlashedIcon = () => (
);
-const PasswordInput = ({ value, onChange, placeholder = "Password", id = "password", error }) => {
+const PasswordInput = ({ value, onChange, placeholder = "Password", id = "password", error, className }) => {
const [isPasswordVisible, setIsPasswordVisible] = useState(false);
const togglePasswordVisibility = () => {
setIsPasswordVisible(prevState => !prevState);
};
+ // Default classes if no className is provided
+ const defaultClasses = "w-full px-4 py-2 mt-2 border rounded-md focus:outline-none focus:ring-1";
+ const errorClasses = error ? 'border-red-500 focus:ring-red-500' : 'focus:ring-blue-600 dark:border-gray-600';
+ const inputClasses = `${defaultClasses} ${errorClasses} ${className ?? ''}`;
+
return (
{isPasswordVisible ?
:
}
diff --git a/frontend/src/pages/LoginPage.jsx b/frontend/src/pages/LoginPage.jsx
index e211bee..d3acd3b 100644
--- a/frontend/src/pages/LoginPage.jsx
+++ b/frontend/src/pages/LoginPage.jsx
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import useAuth from '../hooks/useAuth';
import PasswordInput from '../components/PasswordInput';
+import { HiMail, HiArrowRight } from 'react-icons/hi';
/* // Demo user credentials
const DEMO_EMAIL = 'test@example.com';
@@ -11,17 +12,21 @@ export default function LoginPage() {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [serverError, setServerError] = useState('');
+ const [isLoading, setIsLoading] = useState(false);
const { login } = useAuth();
const handleSubmit = async (e) => {
e.preventDefault();
setServerError(''); // Clear previous server errors
+ setIsLoading(true);
try {
await login(email, password);
// Toast handled globally in AuthContext
} catch (error) {
setServerError(error.message);
// Toast handled globally in AuthContext
+ } finally {
+ setIsLoading(false);
}
};
@@ -31,41 +36,117 @@ export default function LoginPage() {
}; */
return (
-
-
-
+
+ {/* Logo/Brand */}
+
Paisable
-
-
Login to your account
- {serverError &&
{serverError}
}
-