diff --git a/frontend/src/components/Login/Login.js b/frontend/src/components/Login/Login.js index 4442a16..c6bbed4 100644 --- a/frontend/src/components/Login/Login.js +++ b/frontend/src/components/Login/Login.js @@ -6,6 +6,7 @@ function Login() { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); + const [showPassword, setShowPassword] = useState(false); const navigate = useNavigate(); const handleLogin = (e) => { @@ -32,6 +33,11 @@ function Login() { navigate('/signup'); }; + const handleOnClick = () => { // Define the handleOnClick function + setShowPassword(!showPassword); // Toggle the showPassword state + }; + + return (
@@ -56,7 +62,7 @@ function Login() {
setPassword(e.target.value)} required /> -
+ +

@@ -83,4 +100,4 @@ function Login() { ); } -export default Login; +export default Login; \ No newline at end of file diff --git a/frontend/src/components/Signup/Signup.js b/frontend/src/components/Signup/Signup.js index 7843b4c..33cb6a8 100644 --- a/frontend/src/components/Signup/Signup.js +++ b/frontend/src/components/Signup/Signup.js @@ -11,6 +11,18 @@ function Signup() { const [successMessage, setSuccessMessage] = useState(''); const navigate = useNavigate(); +const [showPassword, setShowPassword] = useState(false); +const [showConfirmPassword, setShowConfirmPassword] = useState(false); + +const handlePasswordVisibility = () => { + setShowPassword(!showPassword); +}; + +const handleConfirmPasswordVisibility = () => { + setShowConfirmPassword(!showConfirmPassword); +}; + + const handleSignup = (e) => { e.preventDefault(); @@ -25,7 +37,7 @@ function Signup() { } // Replace with actual signup logic - console.log('Signing up with:', { username, email, password: '****' }); + console.log('Signing up with:', { username, email, password: '' }); // Clear fields and show success message setUsername(''); @@ -78,7 +90,7 @@ function Signup() {

setPassword(e.target.value)} required /> +
setConfirmPassword(e.target.value)} required /> +
@@ -111,4 +145,4 @@ function Signup() {
); } -export default Signup; +export default Signup; \ No newline at end of file