Skip to content

Commit

Permalink
Add Password Hide and Show Eye , Password Strength Progress bar and s…
Browse files Browse the repository at this point in the history
…trong password list
  • Loading branch information
kushalkumar1362 committed May 21, 2024
1 parent 7c86dfb commit 3d79318
Show file tree
Hide file tree
Showing 7 changed files with 306 additions and 93 deletions.
53 changes: 49 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"preview": "vite preview"
},
"dependencies": {
"@fortawesome/free-solid-svg-icons": "^6.5.2",
"@fortawesome/react-fontawesome": "^0.2.1",
"axios": "^1.6.8",
"lucide-react": "^0.378.0",
"react": "^18.2.0",
Expand Down
1 change: 1 addition & 0 deletions frontend/public/hideEye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/public/showEye.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion frontend/src/components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function Navbar() {

return (
<div
className={"w-full h-[8vh] bg-main_theme fixed top-0 z-50 shadow-md"}
className={"w-full h-[8vh] bg-main_theme fixed top-0 z-50 shadow-md relative"}
>
<div className="max-w-7xl mx-auto flex items-center justify-between lg:px-6 px-3 py-1">
{/* logo */}
Expand Down
20 changes: 17 additions & 3 deletions frontend/src/pages/Login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import backgroundImage from "/istockphoto-1073154998-612x612.jpg"; // Import your background image
import { toast } from 'react-toastify'; // Import toast from react-toastify

import showEye from "../../public/showEye.svg";
import hideEye from "../../public/hideEye.svg";
function Login() {
const [password, setPassword] = useState(false);
const [formData, setFormData] = useState({
username: '',
password: '',
Expand Down Expand Up @@ -50,15 +52,27 @@ function Login() {
className='border border-black rounded-md m-2 p-2'
/>
<label htmlFor='password'>Password:</label>
<div className='relative'>
<input
type='password'
type={password ? "text" : "password"}
name='password'
placeholder='Password'
value={formData.password}
onChange={handleInputChange}
id='password'
className='border border-black rounded-md m-2 p-2'
className='border border-black rounded-md m-2 p-2 w-[98%]'
/>
<img
className="absolute w-[30px] top-3 right-5"
title={
password ? "Hide password" : "Show password"
}
src={password ? hideEye : showEye}
onClick={() =>
setPassword((prevState) => !prevState)
}
/>
</div>
<button className='bg-main_theme text-white font-bold py-2 px-4 rounded-md mt-4'>
Login to MediHub
</button>
Expand Down
Loading

0 comments on commit 3d79318

Please sign in to comment.