// 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 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 { address: string; onClose: () => void; } interface State { isNewValid: boolean; isOldValid: boolean; newPass: string; oldPass: string; } class ChangePass extends TxComponent { public state: State = { isNewValid: false, isOldValid: false, newPass: '', oldPass: '' }; public render (): React.ReactNode { const { t } = this.props; return ( {t('Change account password')} {this.renderContent()} {this.renderButtons()} ); } private renderButtons (): React.ReactNode { const { onClose, t } = this.props; const { isNewValid, isOldValid } = this.state; return (