2016-02-25 12:31:21 -08:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
export default class AuthenticationPage extends React.Component {
|
|
|
|
static propTypes = {
|
|
|
|
onLogin: React.PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
2016-10-03 14:25:27 +02:00
|
|
|
state = { email: '' };
|
2016-02-25 12:31:21 -08:00
|
|
|
|
2016-10-03 14:25:27 +02:00
|
|
|
handleLogin = e => {
|
2016-02-25 20:40:35 -08:00
|
|
|
e.preventDefault();
|
2016-02-25 12:31:21 -08:00
|
|
|
this.props.onLogin(this.state);
|
2016-10-03 14:25:27 +02:00
|
|
|
};
|
2016-02-25 12:31:21 -08:00
|
|
|
|
2016-10-03 14:25:27 +02:00
|
|
|
handleEmailChange = e => {
|
2016-09-13 15:30:58 +02:00
|
|
|
this.setState({ email: e.target.value });
|
2016-10-03 14:25:27 +02:00
|
|
|
};
|
2016-02-25 12:31:21 -08:00
|
|
|
|
|
|
|
render() {
|
2016-02-25 20:40:35 -08:00
|
|
|
return <form onSubmit={this.handleLogin}>
|
2016-02-25 12:31:21 -08:00
|
|
|
<p>
|
|
|
|
<label>Your name or email: <input type='text' onChange={this.handleEmailChange}/></label>
|
|
|
|
</p>
|
|
|
|
<p>
|
2016-02-25 20:40:35 -08:00
|
|
|
<button type='submit'>Login</button>
|
2016-02-25 12:31:21 -08:00
|
|
|
</p>
|
2016-02-25 20:40:35 -08:00
|
|
|
</form>;
|
2016-02-25 12:31:21 -08:00
|
|
|
}
|
|
|
|
}
|