Show password feature (#1159)

* show password feauture Implemented

* small typo

* fixed typo
This commit is contained in:
SAI SUMANTH KUMAR 2021-10-21 08:19:01 +05:30 committed by GitHub
parent 8ccdb3eedb
commit ff82ca032d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,6 +15,7 @@ class LoginPage extends React.Component {
this.state = {
isLoading: false,
showPassword: false,
};
}
@ -22,6 +23,10 @@ class LoginPage extends React.Component {
this.setState({ [event.target.name]: event.target.value });
};
handleOnCheck = () => {
this.setState({ showPassword: !this.state.showPassword });
};
authUser = (e) => {
e.preventDefault();
@ -85,7 +90,7 @@ class LoginPage extends React.Component {
<input
onChange={this.handleChange}
name="password"
type="password"
type={this.state.showPassword ?"text" : "password"}
className="form-control"
placeholder="Password"
autoComplete="off"
@ -94,6 +99,21 @@ class LoginPage extends React.Component {
<span className="input-group-text"></span>
</div>
</div>
<div class="form-check">
<input
type="checkbox"
class="form-check-input"
id="check-input"
name="check-input"
onChange = {this.handleOnCheck}
/>
<label
class="form-check-label"
for="check-input"
>
show password
</label>
</div>
<div className="form-footer">
<button
data-testid="loginButton"