-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the Show/Hide Function in the login form (#120)
* Added the Show/Hide Function in the login form I have added some JavaScript to add a function of show and hide to the password field to enhance the User Experience. * Update first-cpp-program.md --------- Co-authored-by: Shubhadip Bhowmik <[email protected]>
- Loading branch information
1 parent
40c5f81
commit 56ddfda
Showing
4 changed files
with
66 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import Link from '@docusaurus/Link'; | ||
import React, { useState } from 'react'; | ||
|
||
<link rel="stylesheet" type="text/css" href="/css/custom.css"></link> | ||
|
||
|
||
|
||
function App() { | ||
const [passwordShown, setPasswordShown] = useState(false); | ||
|
||
const togglePasswordVisibility = () => { | ||
setPasswordShown(!passwordShown); | ||
}; | ||
|
||
return ( | ||
|
||
<div className="form-container"> | ||
<h2>Login</h2> | ||
<form> | ||
<div className="input-container"> | ||
<label htmlFor="email">Email:</label> | ||
<input type="text" id="username" name="username" required /> | ||
</div> | ||
<div className="input-container"> | ||
<label htmlFor="password">Password:</label> | ||
<input | ||
type={passwordShown ? 'text' : 'password'} | ||
id="password" | ||
name="password" | ||
required | ||
></input> | ||
<span><btn className="toggle-password" onClick={togglePasswordVisibility}> | ||
{passwordShown ? 'Hide' : 'Show'} | ||
</btn> | ||
</span> | ||
</div> | ||
| ||
<div className="input-container"> | ||
<button type="submit">Login</button> | ||
<p>Don't have an account yet? <Link to ="signup"> Sign Up</Link></p> | ||
</div> | ||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters