Display free balance for bonding (#2844)

This commit is contained in:
Jaco Greeff 2020-05-28 09:44:09 +02:00 committed by GitHub
parent 07235e9ddf
commit 9a62b7d857
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@
import BN from 'bn.js';
import React, { useState } from 'react';
import { InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components';
import { Available } from '@polkadot/react-query';
import { BalanceFree } from '@polkadot/react-query';
import { useTranslation } from '../../translate';
import ValidateAmount from './InputValidateAmount';
@ -50,8 +50,8 @@ function BondExtra ({ onClose, stashId }: Props): React.ReactElement<Props> {
isError={!!amountError || !maxAdditional || maxAdditional.eqn(0)}
label={t<string>('additional bonded funds')}
labelExtra={
<Available
label={<span className='label'>{t<string>('available')}</span>}
<BalanceFree
label={<span className='label'>{t<string>('balance')}</span>}
params={stashId}
/>
}

View File

@ -7,7 +7,7 @@ import { BondInfo } from './types';
import BN from 'bn.js';
import React, { useCallback, useEffect, useState } from 'react';
import { Dropdown, InputAddress, InputBalance, Modal, Static } from '@polkadot/react-components';
import { Available, BlockToTime } from '@polkadot/react-query';
import { BalanceFree, BlockToTime } from '@polkadot/react-query';
import { useApi } from '@polkadot/react-hooks';
import { useTranslation } from '../../translate';
@ -92,12 +92,12 @@ function Bond ({ className = '', onChange }: Props): React.ReactElement<Props> {
<Modal.Column>
<InputBalance
autoFocus
help={t<string>('The total amount of the stash balance that will be at stake in any forthcoming rounds (should be less than the total amount available)')}
help={t<string>('The total amount of the stash balance that will be at stake in any forthcoming rounds (should be less than the free amount available)')}
isError={!hasValue || !!amountError}
label={t<string>('value bonded')}
labelExtra={
<Available
label={<span className='label'>{t<string>('available')}</span>}
<BalanceFree
label={<span className='label'>{t<string>('balance')}</span>}
params={stashId}
/>
}