// Copyright 2017-2019 @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 { I18nProps } 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 keyring from '@polkadot/ui-keyring'; import { isPasswordValid } from '@polkadot/joy-utils/accounts'; import translate from '../translate'; interface Props extends I18nProps { onClose: () => void; address: string; } interface State { isPassValid: boolean; password: string; } class Backup extends TxComponent { public state: State = { isPassValid: true, 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 (