2016-05-14 16:56:17 +05:30
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
2016-05-23 01:05:55 +05:30
|
|
|
import { Link } from 'react-router';
|
2016-05-14 16:56:17 +05:30
|
|
|
|
2016-08-05 11:13:46 +05:30
|
|
|
import { Input, Checkbox, Captcha } from 'components/ui/form';
|
2016-05-14 16:56:17 +05:30
|
|
|
import BaseAuthBody from 'components/auth/BaseAuthBody';
|
|
|
|
import passwordMessages from 'components/auth/password/Password.intl.json';
|
|
|
|
|
|
|
|
import messages from './Register.intl.json';
|
|
|
|
|
|
|
|
// TODO: password and username can be validate for length and sameness
|
|
|
|
|
|
|
|
export default class RegisterBody extends BaseAuthBody {
|
|
|
|
static displayName = 'RegisterBody';
|
|
|
|
static panelId = 'register';
|
|
|
|
|
|
|
|
autoFocusField = 'username';
|
|
|
|
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
{this.renderErrors()}
|
|
|
|
|
|
|
|
<Input {...this.bindField('username')}
|
|
|
|
icon="user"
|
|
|
|
color="blue"
|
|
|
|
type="text"
|
|
|
|
required
|
|
|
|
placeholder={messages.yourNickname}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Input {...this.bindField('email')}
|
|
|
|
icon="envelope"
|
|
|
|
color="blue"
|
|
|
|
type="email"
|
|
|
|
required
|
|
|
|
placeholder={messages.yourEmail}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Input {...this.bindField('password')}
|
|
|
|
icon="key"
|
|
|
|
color="blue"
|
|
|
|
type="password"
|
|
|
|
required
|
|
|
|
placeholder={passwordMessages.accountPassword}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Input {...this.bindField('rePassword')}
|
|
|
|
icon="key"
|
|
|
|
color="blue"
|
|
|
|
type="password"
|
|
|
|
required
|
|
|
|
placeholder={messages.repeatPassword}
|
|
|
|
/>
|
|
|
|
|
2016-08-05 11:13:46 +05:30
|
|
|
<Captcha {...this.bindField('captcha')} />
|
|
|
|
|
2016-05-14 16:56:17 +05:30
|
|
|
<Checkbox {...this.bindField('rulesAgreement')}
|
|
|
|
color="blue"
|
|
|
|
required
|
|
|
|
label={
|
|
|
|
<Message {...messages.acceptRules} values={{
|
|
|
|
link: (
|
2016-05-23 23:26:15 +05:30
|
|
|
<Link to="/rules" target="_blank">
|
2016-05-14 16:56:17 +05:30
|
|
|
<Message {...messages.termsOfService} />
|
2016-05-23 01:05:55 +05:30
|
|
|
</Link>
|
2016-05-14 16:56:17 +05:30
|
|
|
)
|
|
|
|
}} />
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|