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

53 lines
1.4 KiB
React
Raw Normal View History

import React from 'react';
import { FormattedMessage as Message } from 'react-intl';
import Helmet from 'react-helmet';
import { Link } from 'react-router';
import buttons from 'components/ui/buttons.scss';
2016-05-02 12:45:42 +05:30
import { Input } from 'components/ui/form';
import BaseAuthBody from 'components/auth/BaseAuthBody';
import passwordMessages from 'components/auth/password/Password.intl.json';
import messages from './Login.messages';
class Body extends BaseAuthBody {
static displayName = 'LoginBody';
static panelId = 'login';
autoFocusField = 'login';
render() {
return (
<div>
{this.renderErrors()}
<Input {...this.bindField('login')}
icon="envelope"
required
placeholder={messages.emailOrUsername}
/>
</div>
);
}
}
export default function Login() {
return {
Title: () => ( // TODO: separate component for PageTitle
<Message {...messages.loginTitle}>
{(msg) => <span>{msg}<Helmet title={msg} /></span>}
</Message>
),
Body,
Footer: () => (
<button className={buttons.green} type="submit">
<Message {...messages.next} />
</button>
),
Links: () => (
<span/>
)
};
}