2016-02-25 12:31:21 -08:00
|
|
|
import React from 'react';
|
2016-12-29 18:38:16 -08:00
|
|
|
import Input from "react-toolbox/lib/input";
|
|
|
|
import Button from "react-toolbox/lib/button";
|
|
|
|
import { Card, Icon } from "../../components/UI";
|
|
|
|
import logo from "../netlify-auth/netlify_logo.svg";
|
|
|
|
import styles from "../netlify-auth/AuthenticationPage.css";
|
2016-02-25 12:31:21 -08:00
|
|
|
|
|
|
|
export default class AuthenticationPage extends React.Component {
|
|
|
|
static propTypes = {
|
2016-12-29 18:38:16 -08:00
|
|
|
onLogin: React.PropTypes.func.isRequired,
|
2016-02-25 12:31:21 -08:00
|
|
|
};
|
|
|
|
|
2016-10-03 14:25:27 +02:00
|
|
|
state = { email: '' };
|
2016-02-25 12:31:21 -08:00
|
|
|
|
2016-12-29 18:38:16 -08: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-12-30 09:40:15 -08:00
|
|
|
handleEmailChange = (value) => {
|
|
|
|
this.setState({ email: value });
|
2016-10-03 14:25:27 +02:00
|
|
|
};
|
2016-02-25 12:31:21 -08:00
|
|
|
|
|
|
|
render() {
|
2016-12-29 18:38:16 -08:00
|
|
|
return (<section className={styles.root}>
|
|
|
|
<Card className={styles.card}>
|
|
|
|
<img src={logo} width={100} role="presentation" />
|
2016-12-30 09:40:15 -08:00
|
|
|
<p className={styles.message}>This is a demo, enter your email to start</p>
|
2016-12-29 18:38:16 -08:00
|
|
|
<Input
|
|
|
|
type="text"
|
|
|
|
label="Email"
|
|
|
|
name="email"
|
|
|
|
value={this.state.email}
|
|
|
|
onChange={this.handleEmailChange}
|
|
|
|
/>
|
|
|
|
<Button
|
|
|
|
className={styles.button}
|
|
|
|
raised
|
|
|
|
onClick={this.handleLogin}
|
|
|
|
>
|
|
|
|
<Icon type="login" /> Login
|
|
|
|
</Button>
|
|
|
|
</Card>
|
|
|
|
</section>);
|
2016-02-25 12:31:21 -08:00
|
|
|
}
|
|
|
|
}
|