Add handlers around input in authmenu
This commit is contained in:
parent
a133b24197
commit
6c1e65480b
1 changed files with 28 additions and 5 deletions
|
@ -11,14 +11,25 @@ class AuthMenu extends Component {
|
|||
email: ""
|
||||
}
|
||||
|
||||
this.handleAccountCreation = this.handleAccountCreation.bind(this)
|
||||
this.handleInputChange = this.handleInputChange.bind(this)
|
||||
this.handlePasswordForLogin = this.handlePasswordForLogin.bind(this)
|
||||
this.handleEmailRequest = this.handleEmailRequest.bind(this)
|
||||
this.handleAccountCreation = this.handleAccountCreation.bind(this)
|
||||
this.authMenu = this.authMenu.bind(this)
|
||||
|
||||
}
|
||||
|
||||
|
||||
handleInputChange(event) {
|
||||
const target = event.target;
|
||||
const value = target.value;
|
||||
const name = target.name;
|
||||
|
||||
this.setState({
|
||||
[name]: value
|
||||
});
|
||||
}
|
||||
|
||||
handlePasswordForLogin() {
|
||||
this.setState(state => ({
|
||||
where_in_auth_menu: "requestPasswordForLogin",
|
||||
|
@ -50,8 +61,12 @@ class AuthMenu extends Component {
|
|||
return (
|
||||
<div className="ui menu dropdown" style={{display: "inline"}}>
|
||||
<div className="ui left icon input">
|
||||
<input type="text" placeholder="Username" name="username">
|
||||
</input>
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Username"
|
||||
name="username"
|
||||
onChange={this.handleInputChange}
|
||||
/>
|
||||
<i className="users icon"></i>
|
||||
</div>
|
||||
<div className="fluid ui buttons">
|
||||
|
@ -65,7 +80,11 @@ class AuthMenu extends Component {
|
|||
return (
|
||||
<div className="ui menu dropdown" style={{display: "inline"}}>
|
||||
<div className="ui left icon input">
|
||||
<input type="text" placeholder="Password" name="password">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="Password"
|
||||
name="password">
|
||||
onChange={this.handleInputChange}
|
||||
</input>
|
||||
<i className="lock icon"></i>
|
||||
</div>
|
||||
|
@ -76,7 +95,11 @@ class AuthMenu extends Component {
|
|||
return (
|
||||
<div className="ui menu dropdown" style={{display: "inline"}}>
|
||||
<div className="ui left icon input">
|
||||
<input type="text" placeholder="email@address.tld" name="email">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="email@address.tld"
|
||||
name="email">
|
||||
onChange={this.handleInputChange}
|
||||
</input>
|
||||
<i className="mail icon"></i>
|
||||
</div>
|
||||
|
|
Reference in a new issue