accounts-frontend/packages/app/components/auth/activation/ActivationBody.tsx

58 lines
1.5 KiB
TypeScript
Raw Normal View History

import React from 'react';
2016-05-14 16:56:17 +05:30
import { FormattedMessage as Message } from 'react-intl';
import { Input } from 'app/components/ui/form';
2016-05-14 16:56:17 +05:30
import BaseAuthBody from 'app/components/auth/BaseAuthBody';
2016-05-14 16:56:17 +05:30
import styles from './activation.scss';
import messages from './Activation.intl.json';
export default class ActivationBody extends BaseAuthBody {
static displayName = 'ActivationBody';
static panelId = 'activation';
2016-05-14 16:56:17 +05:30
autoFocusField =
this.props.match.params && this.props.match.params.key ? null : 'key';
2016-05-14 16:56:17 +05:30
render() {
const { key } = this.props.match.params;
const { email } = this.context.user;
2016-06-05 17:46:41 +05:30
return (
<div>
{this.renderErrors()}
2016-05-14 16:56:17 +05:30
<div className={styles.description}>
<div className={styles.descriptionImage} />
2016-05-14 16:56:17 +05:30
<div className={styles.descriptionText}>
{email ? (
<Message
{...messages.activationMailWasSent}
values={{
email: <b>{email}</b>,
}}
/>
) : (
<Message {...messages.activationMailWasSentNoEmail} />
)}
</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
}