ghost-portal/packages/app-accounts/src/modals/CreateConfirmation.tsx
Jaco Greeff 8e971ef7eb
Use ButtonCancel for all Cancel-only buttons (#2164)
* Use ButtonCancel for all Cancel-only buttons

* Small cleanups
2020-01-21 15:47:44 +01:00

48 lines
1.6 KiB
TypeScript

// Copyright 2017-2020 @polkadot/app-accounts authors & contributors
// This software may be modified and distributed under the terms
// of the Apache-2.0 license. See the LICENSE file for details.
import React from 'react';
import { AddressRow, Button, ButtonCancel, Modal } from '@polkadot/react-components';
import { useTranslation } from '../translate';
interface Props {
address: string;
name: string;
onClose: () => void;
onCommit: () => void;
}
export default function CreateConfirmation ({ address, name, onClose, onCommit }: Props): React.ReactElement<Props> | null {
const { t } = useTranslation();
return (
<Modal header={t('Important notice')}>
<Modal.Content>
<AddressRow
defaultName={name}
isInline
noDefaultNameOpacity
value={address}
>
<p>{t('We will provide you with a generated backup file after your account is created. As long as you have access to your account you can always download this file later by clicking on "Backup" button from the Accounts section.')}</p>
<p>{t('Please make sure to save this file in a secure location as it is required, together with your password, to restore your account.')}</p>
</AddressRow>
</Modal.Content>
<Modal.Actions>
<Button.Group>
<ButtonCancel onClick={onClose} />
<Button.Or />
<Button
icon='plus'
isPrimary
label={t('Create and backup account')}
onClick={onCommit}
/>
</Button.Group>
</Modal.Actions>
</Modal>
);
}