diff options
author | 2018-06-25 13:02:30 +0300 | |
---|---|---|
committer | 2023-01-13 10:37:53 +0300 | |
commit | 28679bfba2d4160cd54fe368e5412aa622cd8c6e (patch) | |
tree | a532f4074a9492733a9bad67ed552d8bf18bb3ee /vnext/src/components/LoginButton.js | |
parent | cfc03954dcc9d4446e5993c6cdfb5e7e73d71a71 (diff) |
transform-class-properties
Diffstat (limited to 'vnext/src/components/LoginButton.js')
-rw-r--r-- | vnext/src/components/LoginButton.js | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/vnext/src/components/LoginButton.js b/vnext/src/components/LoginButton.js index 22ae2198..fb3c087e 100644 --- a/vnext/src/components/LoginButton.js +++ b/vnext/src/components/LoginButton.js @@ -11,25 +11,24 @@ export default class LoginButton extends React.Component { username: '', password: '' }; - this.toggleModal = this.toggleModal.bind(this); } - toggleModal(event) { + toggleModal = (event) => { if (event) event.preventDefault() this.setState({ isOpen: !this.state.isOpen }); } - usernameChanged(event) { + usernameChanged = (event) => { this.setState({ username: event.target.value }) } - passwordChanged(event) { + passwordChanged = (event) => { this.setState({ password: event.target.value }) } - login(event) { + login = (event) => { event.preventDefault(); let headers = new Headers(); headers.append('Authorization', 'Basic ' + window.btoa(unescape(encodeURIComponent(this.state.username + ":" + this.state.password)))); @@ -67,16 +66,16 @@ export default class LoginButton extends React.Component { </a> </div> <p>Already registered?</p> - <form onSubmit={this.login.bind(this)}> + <form onSubmit={this.login}> <input className="signinput" type="text" name="username" placeholder="Username..." - value={this.state.username} onChange={this.usernameChanged.bind(this)} /><br /> + value={this.state.username} onChange={this.usernameChanged} /><br /> <input className="signinput" type="password" name="password" placeholder="Password..." - value={this.state.password} onChange={this.passwordChanged.bind(this)} /><br /> + value={this.state.password} onChange={this.passwordChanged} /><br /> <input className="signsubmit" type="submit" value="OK" /> </form> </div> |