static-cms/src/backends/test-repo/AuthenticationPage.js

47 lines
1.2 KiB
JavaScript
Raw Normal View History

import React from 'react';
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";
export default class AuthenticationPage extends React.Component {
static propTypes = {
onLogin: React.PropTypes.func.isRequired,
};
2016-10-03 14:25:27 +02:00
state = { email: '' };
handleLogin = (e) => {
e.preventDefault();
this.props.onLogin(this.state);
2016-10-03 14:25:27 +02:00
};
handleEmailChange = (value) => {
this.setState({ email: value });
2016-10-03 14:25:27 +02:00
};
render() {
return (<section className={styles.root}>
<Card className={styles.card}>
<img src={logo} width={100} role="presentation" />
<p className={styles.message}>This is a demo, enter your email to start</p>
<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>);
}
}