2017-07-22 21:27:38 +05:30
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { FormattedMessage as Message } from 'react-intl';
|
|
|
|
|
2017-08-20 21:15:21 +05:30
|
|
|
import { Input, Form, FormModel } from 'components/ui/form';
|
2017-07-22 21:27:38 +05:30
|
|
|
|
|
|
|
import profileForm from 'components/profile/profileForm.scss';
|
|
|
|
import messages from '../MultiFactorAuth.intl.json';
|
|
|
|
|
|
|
|
export default function Confirmation({
|
|
|
|
form,
|
2017-08-20 21:15:21 +05:30
|
|
|
formRef = () => {},
|
|
|
|
onSubmit,
|
|
|
|
onInvalid
|
2017-07-22 21:27:38 +05:30
|
|
|
}: {
|
|
|
|
form: FormModel,
|
2017-08-20 21:15:21 +05:30
|
|
|
formRef?: (el: ?Form) => void,
|
|
|
|
onSubmit: () => Promise<*>,
|
|
|
|
onInvalid: Function
|
2017-07-22 21:27:38 +05:30
|
|
|
}) {
|
|
|
|
return (
|
2017-08-20 21:15:21 +05:30
|
|
|
<Form form={form}
|
|
|
|
onSubmit={onSubmit}
|
|
|
|
onInvalid={onInvalid}
|
|
|
|
ref={formRef}
|
|
|
|
>
|
|
|
|
<div className={profileForm.formBody}>
|
|
|
|
<div className={profileForm.formRow}>
|
|
|
|
<p className={profileForm.description}>
|
|
|
|
<Message {...messages.enterCodeFromApp} />
|
|
|
|
</p>
|
|
|
|
</div>
|
2017-07-22 21:27:38 +05:30
|
|
|
|
2017-08-20 21:15:21 +05:30
|
|
|
<div className={profileForm.formRow}>
|
|
|
|
<Input {...form.bindField('totp')}
|
|
|
|
required
|
|
|
|
autoComplete="off"
|
|
|
|
skin="light"
|
|
|
|
placeholder={messages.codePlaceholder}
|
|
|
|
/>
|
|
|
|
</div>
|
2017-07-22 21:27:38 +05:30
|
|
|
</div>
|
2017-08-20 21:15:21 +05:30
|
|
|
</Form>
|
2017-07-22 21:27:38 +05:30
|
|
|
);
|
|
|
|
}
|