2016-05-14 16:56:17 +05:30
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
|
|
|
|
|
|
|
import { Input } from 'components/ui/form';
|
|
|
|
import BaseAuthBody from 'components/auth/BaseAuthBody';
|
|
|
|
|
|
|
|
import styles from './forgotPassword.scss';
|
|
|
|
import messages from './ForgotPassword.intl.json';
|
|
|
|
|
|
|
|
export default class ForgotPasswordBody extends BaseAuthBody {
|
|
|
|
static displayName = 'ForgotPasswordBody';
|
|
|
|
static panelId = 'forgotPassword';
|
|
|
|
static hasGoBack = true;
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const {user} = this.context;
|
2016-05-15 02:23:58 +05:30
|
|
|
const hasIdentity = user.email || user.username;
|
|
|
|
const message = hasIdentity ? messages.pleasePressButton : messages.specifyEmail;
|
2016-05-14 16:56:17 +05:30
|
|
|
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
{this.renderErrors()}
|
|
|
|
|
|
|
|
<p className={styles.descriptionText}>
|
2016-05-15 02:23:58 +05:30
|
|
|
<Message {...message} />
|
2016-05-14 16:56:17 +05:30
|
|
|
</p>
|
|
|
|
|
2016-05-15 02:23:58 +05:30
|
|
|
{hasIdentity ? null : (
|
|
|
|
<Input {...this.bindField('email')}
|
|
|
|
icon="envelope"
|
|
|
|
color="lightViolet"
|
|
|
|
required
|
|
|
|
placeholder={messages.accountEmail}
|
|
|
|
defaultValue={user.email || user.username}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
|
2016-05-14 16:56:17 +05:30
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|