diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index 9230599b2e..2604e173c5 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -159,7 +159,7 @@ function renderExtended ({ balancesAll, address, withExtended }: Props, t: (key: ); } -function renderUnlocking ({ stakingInfo }: Props, t: (key: string, data: any) => string): React.ReactNode { +function renderUnlocking ({ address, stakingInfo }: Props, t: (key: string, data: any) => string): React.ReactNode { if (!stakingInfo || !stakingInfo.unlocking || !stakingInfo.unlocking.length) { return null; } @@ -176,7 +176,7 @@ function renderUnlocking ({ stakingInfo }: Props, t: (key: string, data: any) => ( @@ -189,7 +189,7 @@ function renderUnlocking ({ stakingInfo }: Props, t: (key: string, data: any) => })} ))} - trigger='unlocking-trigger' + trigger={`${address}-unlocking-trigger`} /> ); @@ -238,7 +238,7 @@ function renderValidatorPrefs ({ stakingInfo, withValidatorPrefs = false }: Prop } function renderBalances (props: Props, allAccounts: string[], t: (key: string) => string): React.ReactNode { - const { balancesAll, stakingInfo, withBalance = true, withBalanceToggle = false } = props; + const { address, balancesAll, stakingInfo, withBalance = true, withBalanceToggle = false } = props; const balanceDisplay = withBalance === true ? DEFAULT_BALANCES : withBalance || false; @@ -249,6 +249,7 @@ function renderBalances (props: Props, allAccounts: string[], t: (key: string) = const [ownBonded, otherBonded] = calcBonded(stakingInfo, balanceDisplay.bonded); const controllerId = stakingInfo?.controllerId?.toString(); + const isAllLocked = !!balancesAll && balancesAll.lockedBreakdown.some(({ amount }): boolean => amount.isMax()); const allItems = ( <> @@ -279,13 +280,30 @@ function renderBalances (props: Props, allAccounts: string[], t: (key: string) = /> )} - {balanceDisplay.locked && balancesAll?.lockedBalance?.gtn(0) && ( + {balanceDisplay.locked && balancesAll && (isAllLocked || balancesAll.lockedBalance.gtn(0)) && ( <>