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