Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-#257: Implemented show/hide password functionality #364

Merged

Conversation

rushil-b-patel
Copy link
Contributor

@rushil-b-patel rushil-b-patel commented May 26, 2024

Summary

Implemented the show/hide password functionality with state & react icons.

Description

  1. Added a new state for passwordvisible and setpasswordvisible function to set the value true/false.
  2. Included the state in type attribute of input field of password, which toggles the type from text to password according to the state's value.
  3. Add new svg files of eye & eye-off in the assets folder.
  4. And finally implement a button which toggles the state's value from false to true and vice-versa using SVG icons.

Images

passwordVisibility.webm
(it supports the mobile responsive also so no need to change any thing :) )

Issue(s) Addressed

Closes #257

Prerequisites

Copy link

vercel bot commented May 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
wanderlust ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 4:25am
wanderlust-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 28, 2024 4:25am

Copy link

Hey @rushil-b-patel! Thanks for sticking to the guidelines! High five! 🙌🏻

Copy link

Hey @rushil-b-patel! Thanks for sticking to the guidelines! High five! 🙌🏻

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the first commit "revert" doesn't follow the guidelines, but i'll let it slide. Kindly address the review comments

backend/app.js Outdated
@@ -16,7 +16,7 @@ app.use(cors({
credentials: true
}));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(express.urlencoded());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what I was saying that I commited that payload vala change but I tried to undo that commit through revert but I don't I didn't find my way but managed to undo in this commit. So it will the same the app.js (backend) won't change.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

payload vala change, i didn't get.
But if this is unexpected and want to get back, make a new commit reverting the changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umm what I was saying is that I made a commit changing the app.use(express.urlencoded()); to app.use(express.urlencoded({ extended: true })); but I revert the changes while addressing this password vala issue so in this commit it will get back to normal app.use(express.urlencoded()); which is already there in the main branch, so it won't affect.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh okay, you are saying previously you were the one who made this changes is it?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

umm what I was saying is that I made a commit changing the app.use(express.urlencoded()); to app.use(express.urlencoded({ extended: true }));

This never happened in the main branch, it might be in the private branch

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just change it back to this so that I can merge app.use(express.urlencoded({ extended: true }));

Just do this,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it was in private repo.
You want to change from app.use(express.urlencoded()); to this app.use(express.urlencoded({ extended: true }));..? @krishnaacharyaa

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any update...? @krishnaacharyaa

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated long time ago with the emoji

className="absolute inset-y-0 right-0 flex items-center pr-3 text-sm leading-5"
>
<img src={passwordVisible ? EyeOffIcon : EyeIcon} alt="Toggle-visibility" className="w-5 h-5" />
</button>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{passwordVisible ? EyeOffIcon : EyeIcon} ideally should be {passwordVisible ? EyeIcon : EyeOffIcon}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh My bad, yes you are correct. Let me change that...

type="button"
onClick={() => setPasswordVisible(!passwordVisible)}
className="absolute inset-y-0 right-0 flex items-center pr-3 text-sm leading-5"
>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly make sure if this works in the mobile screen as well, can you add the video recorded for the mobile screen as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Hey @rushil-b-patel! Thanks for sticking to the guidelines! High five! 🙌🏻

@rushil-b-patel
Copy link
Contributor Author

rushil-b-patel commented May 27, 2024

good to go...! @krishnaacharyaa

@rushil-b-patel
Copy link
Contributor Author

Good to go.. @krishnaacharyaa ...!

Copy link
Owner

@krishnaacharyaa krishnaacharyaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@krishnaacharyaa krishnaacharyaa merged commit d6a5a04 into krishnaacharyaa:main May 28, 2024
3 checks passed
@krishnaacharyaa krishnaacharyaa added gssoc Issue can be taken under GSSoC level1 labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gssoc Issue can be taken under GSSoC level1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide and visible in password to improve UI
2 participants