diff --git a/packages/app-accounts/src/modals/Backup.tsx b/packages/app-accounts/src/modals/Backup.tsx index 663f408c7fdf..daecfa763293 100644 --- a/packages/app-accounts/src/modals/Backup.tsx +++ b/packages/app-accounts/src/modals/Backup.tsx @@ -2,142 +2,151 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { I18nProps } from '@polkadot/react-components/types'; +import { BareProps } from '@polkadot/react-components/types'; import FileSaver from 'file-saver'; -import React from 'react'; -import { AddressRow, Button, Modal, Password, TxComponent } from '@polkadot/react-components'; -import { ActionStatus } from '@polkadot/react-components/Status/types'; +import React, { useState, useMemo } from 'react'; +import { AddressRow, Button, Modal, Password } from '@polkadot/react-components'; import keyring from '@polkadot/ui-keyring'; -import translate from '../translate'; +import { useTranslation } from '../translate'; -interface Props extends I18nProps { +interface Props extends BareProps { onClose: () => void; address: string; } -interface State { - isPassValid: boolean; - password: string; -} - -class Backup extends TxComponent { - public state: State = { - isPassValid: false, - password: '' - }; - - public render (): React.ReactNode { - const { t } = this.props; - - return ( - - {t('Backup account')} - {this.renderContent()} - {this.renderButtons()} - - ); - } - - private renderButtons (): React.ReactNode { - const { onClose, t } = this.props; - const { isPassValid } = this.state; - - return ( - - -