// 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 { ActionStatus } from '@polkadot/ui-app/Status/types'; import { SubjectInfo } from '@polkadot/ui-keyring/observable/types'; import React from 'react'; import { AddressSummary, Button, Input, InputAddress } from '@polkadot/ui-app/index'; import keyring from '@polkadot/ui-keyring'; import Backup from './Backup'; import ChangePass from './ChangePass'; import Forgetting from './Forgetting'; import translate from './translate'; type Props = I18nProps & { allAccounts?: SubjectInfo, onStatusChange: (status: ActionStatus) => void }; type State = { current: KeyringPair | null, editedName: string, isBackupOpen: boolean, isEdited: boolean, isForgetOpen: boolean, isPasswordOpen: boolean }; class Editor extends React.PureComponent { state: State; constructor (props: Props) { super(props); this.state = this.createState(null); } render () { return (
{this.renderModals()} {this.renderData()} {this.renderButtons()}
); } renderButtons () { const { t } = this.props; const { current, isEdited } = this.state; if (!current) { return null; } return (