Display locked amounts (#1784)

This commit is contained in:
Jaco Greeff 2019-10-28 11:26:52 +01:00 committed by GitHub
parent 05f477da53
commit 5c380308ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -20,7 +20,7 @@ interface Props extends I18nProps {
className?: string;
}
const WITH_BALANCE = { available: true, bonded: true, free: true, reserved: true, total: true };
const WITH_BALANCE = { available: true, bonded: true, free: true, locked: true, reserved: true, total: true };
const WITH_EXTENDED = { nonce: true };
const isEditable = true;

View File

@ -22,6 +22,7 @@ import translate from './translate';
export interface BalanceActiveType {
available?: boolean;
bonded?: boolean | BN[];
locked?: boolean;
redeemable?: boolean;
reserved?: boolean;
total?: boolean;
@ -53,6 +54,7 @@ interface Props extends BareProps, I18nProps {
const DEFAULT_BALANCES: BalanceActiveType = {
available: true,
bonded: true,
locked: true,
redeemable: true,
reserved: true,
total: true,
@ -209,6 +211,12 @@ function renderBalances (props: Props): React.ReactNode {
<div className='result'>{formatBalance(balances_all.availableBalance)}</div>
</>
)}
{balanceDisplay.locked && balances_all.lockedBalance && balances_all.lockedBalance.gtn(0) && (
<>
<Label label={t('locked')} />
<div className='result'>{formatBalance(balances_all.lockedBalance)}</div>
</>
)}
{balanceDisplay.reserved && balances_all.reservedBalance && balances_all.reservedBalance.gtn(0) && (
<>
<Label label={t('reserved')} />