From 16f2b31029c68a12123e2f0e547bf2a3b8ecc867 Mon Sep 17 00:00:00 2001 From: Shrey Hirapara Date: Thu, 28 May 2026 18:37:00 +0530 Subject: [PATCH 1/2] fix: restore password visibility toggle on login page --- src/pages/Login/Login.tsx | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/pages/Login/Login.tsx b/src/pages/Login/Login.tsx index 92b7073e..f5730e7f 100644 --- a/src/pages/Login/Login.tsx +++ b/src/pages/Login/Login.tsx @@ -1,6 +1,7 @@ import React, { useState, ChangeEvent, FormEvent, useContext } from "react"; import axios from "axios"; import { useNavigate, Link } from "react-router-dom"; +import { Eye, EyeOff } from "lucide-react"; import { ThemeContext } from "../../context/ThemeContext"; import type { ThemeContextType } from "../../context/ThemeContext"; @@ -15,6 +16,7 @@ const Login: React.FC = () => { const [formData, setFormData] = useState({ email: "", password: "" }); const [message, setMessage] = useState(""); const [isLoading, setIsLoading] = useState(false); + const [showPassword, setShowPassword] = useState(false); const navigate = useNavigate(); const themeContext = useContext(ThemeContext) as ThemeContextType; @@ -108,20 +110,27 @@ const Login: React.FC = () => {
-
+ type={showPassword ? "text" : "password"} + name="password" + autoComplete="current-password" + placeholder="Enter your password" + value={formData.password} + onChange={handleChange} + required + className={`w-full pl-4 pr-12 py-4 rounded-2xl focus:outline-none transition-all ${ + mode === "dark" + ? "bg-white/5 border border-white/10 text-white placeholder-slate-400 focus:ring-2 focus:ring-purple-500" + : "bg-gray-100 border border-gray-300 text-gray-900 placeholder-gray-500 focus:ring-2 focus:ring-purple-400" + }`} + /> + +