// Copyright 2017-2018 @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 { KeyringPair } from '@polkadot/keyring/types'; import { I18nProps } from '@polkadot/ui-app/types'; import FileSaver from 'file-saver'; import React from 'react'; import { AddressSummary, Button, Modal, Password } from '@polkadot/ui-app/index'; import { ActionStatus } from '@polkadot/ui-app/Status/types'; import keyring from '@polkadot/ui-keyring'; import translate from './translate'; type Props = I18nProps & { onStatusChange: (status: ActionStatus) => void, onClose: () => void, pair: KeyringPair }; type State = { isPassValid: boolean, password: string }; class Backup extends React.PureComponent { state: State; constructor (props: Props) { super(props); this.state = { isPassValid: false, password: '' }; } render () { return ( {this.renderContent()} {this.renderButtons()} ); } renderButtons () { const { onClose, t } = this.props; const { isPassValid } = this.state; return (