diff --git a/packages/app-accounts/package.json b/packages/app-accounts/package.json index 662e5b4730..431d7b12bd 100644 --- a/packages/app-accounts/package.json +++ b/packages/app-accounts/package.json @@ -11,6 +11,8 @@ "license": "ISC", "dependencies": { "@babel/runtime": "^7.0.0", - "@polkadot/ui-app": "^0.20.19" + "@polkadot/ui-app": "^0.20.19", + "@types/file-saver": "^1.3.0", + "file-saver": "^1.3.8" } } diff --git a/packages/app-accounts/src/Backup.tsx b/packages/app-accounts/src/Backup.tsx new file mode 100644 index 0000000000..e9ed3bc281 --- /dev/null +++ b/packages/app-accounts/src/Backup.tsx @@ -0,0 +1,150 @@ +// Copyright 2017-2018 @polkadot/app-accounts authors & contributors +// This software may be modified and distributed under the terms +// of the ISC license. See the LICENSE file for details. + +import { KeyringPair } from '@polkadot/util-keyring/types'; +import { I18nProps } from '@polkadot/ui-app/types'; + +import FileSaver from 'file-saver'; +import React from 'react'; +import Button from '@polkadot/ui-app/Button'; +import Modal from '@polkadot/ui-app/Modal'; +import Password from '@polkadot/ui-app/Password'; +import AddressSummary from '@polkadot/ui-app/AddressSummary'; + +import translate from './translate'; + +type Props = I18nProps & { + 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 ( + + +