2017-08-23 00:19:50 +05:30
|
|
|
|
import React from 'react';
|
2016-05-14 16:56:17 +05:30
|
|
|
|
|
2020-06-04 22:11:27 +05:30
|
|
|
|
import { defineMessages, FormattedMessage as Message } from 'react-intl';
|
2016-05-14 16:56:17 +05:30
|
|
|
|
|
2019-12-08 00:32:00 +05:30
|
|
|
|
import { Input } from 'app/components/ui/form';
|
2016-05-14 16:56:17 +05:30
|
|
|
|
|
2019-12-08 00:32:00 +05:30
|
|
|
|
import BaseAuthBody from 'app/components/auth/BaseAuthBody';
|
2016-05-14 16:56:17 +05:30
|
|
|
|
import styles from './activation.scss';
|
2020-06-04 22:11:27 +05:30
|
|
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
|
enterTheCode: 'Enter the code from E‑mail here',
|
|
|
|
|
});
|
2016-05-14 16:56:17 +05:30
|
|
|
|
|
|
|
|
|
export default class ActivationBody extends BaseAuthBody {
|
2020-05-24 04:38:24 +05:30
|
|
|
|
static displayName = 'ActivationBody';
|
|
|
|
|
static panelId = 'activation';
|
|
|
|
|
|
|
|
|
|
autoFocusField = this.props.match.params && this.props.match.params.key ? null : 'key';
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
const { key } = this.props.match.params;
|
|
|
|
|
const { email } = this.context.user;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
{this.renderErrors()}
|
|
|
|
|
|
|
|
|
|
<div className={styles.description}>
|
|
|
|
|
<div className={styles.descriptionImage} />
|
|
|
|
|
|
|
|
|
|
<div className={styles.descriptionText}>
|
|
|
|
|
{email ? (
|
|
|
|
|
<Message
|
2020-06-04 22:11:27 +05:30
|
|
|
|
key="activationMailWasSent"
|
|
|
|
|
defaultMessage="Please check {email} for the message with further instructions"
|
2020-05-24 04:38:24 +05:30
|
|
|
|
values={{
|
|
|
|
|
email: <b>{email}</b>,
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
) : (
|
2020-06-04 22:11:27 +05:30
|
|
|
|
<Message
|
|
|
|
|
key="activationMailWasSentNoEmail"
|
|
|
|
|
defaultMessage="Please check your E‑mail for the message with further instructions"
|
|
|
|
|
/>
|
2020-05-24 04:38:24 +05:30
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className={styles.formRow}>
|
|
|
|
|
<Input
|
|
|
|
|
{...this.bindField('key')}
|
|
|
|
|
color="blue"
|
|
|
|
|
center
|
|
|
|
|
required
|
|
|
|
|
value={key}
|
|
|
|
|
readOnly={!!key}
|
|
|
|
|
autoComplete="off"
|
|
|
|
|
placeholder={messages.enterTheCode}
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|
2016-05-14 16:56:17 +05:30
|
|
|
|
}
|