accounts-frontend/src/components/auth/Login.jsx

56 lines
1.7 KiB
React
Raw Normal View History

import React, { Component } from 'react';
import { connect } from 'react-redux';
import { routeActions } from 'redux-simple-router';
import { FormattedMessage as Message } from 'react-intl';
import Helmet from 'react-helmet';
import buttons from 'components/ui/buttons.scss';
import { Panel, PanelBody, PanelFooter } from 'components/ui/Panel';
import { Input } from 'components/ui/Form';
import messages from './Login.messages';
import {helpLinks as helpLinksStyles} from './helpLinks.scss';
import passwordMessages from './Password.messages';
class Login extends Component {
displayName = 'Login';
render() {
return (
<div>
2016-01-21 11:59:11 +05:30
<Message {...messages.loginTitle}>
{(msg) => <Helmet title={msg} />}
</Message>
2016-01-21 11:59:11 +05:30
<Panel title={<Message {...messages.loginTitle} />}>
<PanelBody>
<Input icon="envelope" type="email" placeholder={messages.emailOrUsername} />
</PanelBody>
<PanelFooter>
<button className={buttons.green} onClick={this.onSubmit}>
<Message {...messages.next} />
</button>
</PanelFooter>
</Panel>
<div className={helpLinksStyles}>
<a href="#">
<Message {...passwordMessages.forgotPassword} />
</a>
</div>
</div>
);
}
onSubmit = (event) => {
event.preventDefault();
this.props.push('/password');
};
}
export default connect(null, {
push: routeActions.push
})(Login);