diff --git a/packages/app-accounts/src/Account.tsx b/packages/app-accounts/src/Account.tsx index 31a14ed53e..57cb80bc2e 100644 --- a/packages/app-accounts/src/Account.tsx +++ b/packages/app-accounts/src/Account.tsx @@ -113,9 +113,9 @@ class Account extends React.PureComponent { if (isTransferOpen) { modals.push( ); } diff --git a/packages/app-accounts/src/modals/Transfer.tsx b/packages/app-accounts/src/modals/Transfer.tsx index 2bcaaa9586..9096cfc81f 100644 --- a/packages/app-accounts/src/modals/Transfer.tsx +++ b/packages/app-accounts/src/modals/Transfer.tsx @@ -20,10 +20,11 @@ import { ZERO_FEES } from '@polkadot/ui-signer/Checks/constants'; import translate from '../translate'; type Props = ApiProps & I18nProps & { - address?: string, balances_fees?: DerivedFees, balances_votingBalance?: DerivedBalances, onClose: () => void, + recipientId?: string, + senderId?: string, system_accountNonce?: BN }; @@ -76,8 +77,8 @@ class Transfer extends React.PureComponent { extrinsic: null, hasAvailable: true, maxBalance: ZERO, - recipientId: null, - senderId: props.address || null + recipientId: props.recipientId || null, + senderId: props.senderId || null }; } @@ -158,7 +159,7 @@ class Transfer extends React.PureComponent { } private renderContent () { - const { address, t } = this.props; + const { recipientId: propRecipientId, senderId: propSenderId, t } = this.props; const { extrinsic, hasAvailable, maxBalance, recipientId, senderId } = this.state; const available = {t('available ')}; @@ -166,16 +167,18 @@ class Transfer extends React.PureComponent {
{ +class Address extends React.PureComponent { state: State; constructor (props: Props) { @@ -35,7 +37,8 @@ class Address extends React.PureComponent { this.state = { current: keyring.getAddress(address), isEditable: true, - isForgetOpen: false + isForgetOpen: false, + isTransferOpen: false }; } @@ -65,7 +68,7 @@ class Address extends React.PureComponent { private renderModals () { const { address } = this.props; - const { isForgetOpen, current } = this.state; + const { isForgetOpen, isTransferOpen, current } = this.state; if (!address) { return null; @@ -78,21 +81,35 @@ class Address extends React.PureComponent { ); } + if (isTransferOpen) { + modals.push( + + ); + } + return modals; } private toggleForget = (): void => { - const { isForgetOpen } = this.state; - - this.setState({ + this.setState(({ isForgetOpen }) => ({ isForgetOpen: !isForgetOpen - }); + })); + } + + private toggleTransfer = (): void => { + this.setState(({ isTransferOpen }) => ({ + isTransferOpen: !isTransferOpen + })); } private onForget = (): void => { @@ -129,11 +146,20 @@ class Address extends React.PureComponent { isNegative onClick={this.toggleForget} icon='trash' + key='forget' size='small' tooltip={t('Forget this account')} /> )} +