-
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.
Addition of Hide /Show Functionality in the Sign-up page done . (#218)
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
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>SignUp</h2> | ||
<form> | ||
<div className="input-container"> | ||
<label htmlFor="Username">Username:</label> | ||
<input type="text" id="username" name="username" required /> | ||
</div> | ||
<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">SignUp</button> | ||
<p>Don't have an account yet? <Link to ="Login"> Login</Link></p> | ||
</div> | ||
</form> | ||
</div> | ||
); | ||
} | ||
|
||
export default App; |