Compare commits

...

3 Commits

2 changed files with 19 additions and 9 deletions

View File

@ -542,7 +542,7 @@ export default function App() {
return; return;
} }
if (changeNewPassword !== changeConfirmPassword) { if (changeNewPassword !== changeConfirmPassword) {
setChangePasswordError('New passwords do not match.'); setChangePasswordError('Confirm password do not match.');
return; return;
} }

View File

@ -77,6 +77,7 @@ export const ProfileDrawer: React.FC<ProfileDrawerProps> = ({
}) => { }) => {
const [showOldPassword, setShowOldPassword] = useState(false); const [showOldPassword, setShowOldPassword] = useState(false);
const [showNewPassword, setShowNewPassword] = useState(false); const [showNewPassword, setShowNewPassword] = useState(false);
const [showConfirmPassword, setShowConfirmPassword] = useState(false);
const parsed = parsePhoneNumber(profilePhone, profileCountry); const parsed = parsePhoneNumber(profilePhone, profileCountry);
const [dialCode, setDialCode] = useState(parsed.dialCode); const [dialCode, setDialCode] = useState(parsed.dialCode);
@ -300,14 +301,23 @@ export const ProfileDrawer: React.FC<ProfileDrawerProps> = ({
<div className="space-y-1"> <div className="space-y-1">
<label className="text-xs font-bold text-slate-500">Confirm New Password</label> <label className="text-xs font-bold text-slate-500">Confirm New Password</label>
<input <div className="relative">
type="password" <input
required type={showConfirmPassword ? 'text' : 'password'}
value={changeConfirmPassword} required
onChange={(e) => setChangeConfirmPassword(e.target.value)} value={changeConfirmPassword}
placeholder="Repeat new password" onChange={(e) => setChangeConfirmPassword(e.target.value)}
className="w-full bg-white border border-slate-200 rounded-xl px-3 py-2 text-xs font-semibold text-slate-800 focus:outline-none focus:border-indigo-500" placeholder="Repeat new password"
/> className="w-full bg-white border border-slate-200 rounded-xl px-3 py-2 pr-10 text-xs font-semibold text-slate-800 focus:outline-none focus:border-indigo-500"
/>
<button
type="button"
onClick={() => setShowConfirmPassword(!showConfirmPassword)}
className="absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 p-0.5"
>
{showConfirmPassword ? <EyeOff className="h-3.5 w-3.5" /> : <Eye className="h-3.5 w-3.5" />}
</button>
</div>
</div> </div>
<div className="flex flex-wrap gap-2 text-[10px] text-slate-500 pt-1"> <div className="flex flex-wrap gap-2 text-[10px] text-slate-500 pt-1">