Skip to content

Commit

Permalink
Update profile.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
TanishqMehrunkarIIPSDAVV authored Oct 10, 2024
1 parent 603431a commit 0667e57
Showing 1 changed file with 40 additions and 6 deletions.
46 changes: 40 additions & 6 deletions src/Profile/profile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,28 @@ const Profile = () => {
<div className="profile-password-field">
<input
type={showPassword ? "text" : "password"}
className={passwordsMatch ? 'profile-input-normal' : 'profile-input-faded'}
className={
passwordsMatch
? "profile-input-normal"
: "profile-input-faded"
}
value={newProfileData.password}
onChange={(e) => setNewProfileData({ ...newProfileData, password: e.target.value })}
onChange={(e) => {
setNewProfileData({
...newProfileData,
password: e.target.value,
});
if(e.target.value == newProfileData.confirmPassword){
setPasswordMatch(true);
}else{
setPasswordMatch(false);
}
}}
/>
<span onClick={togglePasswordVisibility} className="profile-eye-icon">
<span
onClick={togglePasswordVisibility}
className="profile-eye-icon"
>
{showPassword ? <FaEyeSlash /> : <FaEye />}
</span>
</div>
Expand All @@ -216,11 +233,28 @@ const Profile = () => {
<div className="profile-password-field">
<input
type={showConfirmPassword ? "text" : "password"}
className={passwordsMatch ? 'profile-input-normal' : 'profile-input-faded'}
className={
passwordsMatch
? "profile-input-normal"
: "profile-input-faded"
}
value={newProfileData.confirmPassword}
onChange={(e) => setNewProfileData({ ...newProfileData, confirmPassword: e.target.value })}
onChange={(e) => {
setNewProfileData({
...newProfileData,
confirmPassword: e.target.value,
});
if(newProfileData.password == e.target.value){
setPasswordMatch(true);
}else{
setPasswordMatch(false);
}
}}
/>
<span onClick={toggleConfirmPasswordVisibility} className="profile-eye-icon">
<span
onClick={toggleConfirmPasswordVisibility}
className="profile-eye-icon"
>
{showConfirmPassword ? <FaEyeSlash /> : <FaEye />}
</span>
</div>
Expand Down

0 comments on commit 0667e57

Please sign in to comment.