From be808d13144225d276f1cfb2615656f3d28bf3ad Mon Sep 17 00:00:00 2001 From: Jaco Date: Thu, 5 May 2022 07:08:11 +0200 Subject: [PATCH] Display pool nominees in pool summary (#7528) --- packages/page-staking/src/Pools/Pool.tsx | 29 +++++++++++++++++++---- packages/page-staking/src/Pools/Pools.tsx | 7 +++--- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/packages/page-staking/src/Pools/Pool.tsx b/packages/page-staking/src/Pools/Pool.tsx index c44e42fd0e..2823703d33 100644 --- a/packages/page-staking/src/Pools/Pool.tsx +++ b/packages/page-staking/src/Pools/Pool.tsx @@ -42,17 +42,39 @@ function Pool ({ className = '', members, ownAccounts, params, poolId }: Props): [members] ); + const renderNominees = useCallback( + () => info && info.nominating.map((stashId, count) => ( + + )), + [info] + ); + return ( <>

{formatNumber(poolId)}

{info && info.metadata} - {info && info.bonded.state.type} + {info && info.bonded.state.type} {info && } - {info && !info.rewardClaimable.isZero() && } + {info && !info.rewardClaimable.isZero() && } + + {info && info.nominating.length !== 0 && ( + ('No nominees')} + renderChildren={renderNominees} + summary={t('Nominees ({{count}})', { replace: { count: info.nominating.length } })} + /> + )} + {members && members.length !== 0 && ( ('No members')} renderChildren={renderMembers} summary={t('Members ({{count}})', { replace: { count: members.length } })} @@ -99,8 +121,7 @@ function Pool ({ className = '', members, ownAccounts, params, poolId }: Props):
- - +
{t('stash')}
diff --git a/packages/page-staking/src/Pools/Pools.tsx b/packages/page-staking/src/Pools/Pools.tsx index 253a0bb6bb..a1df342a74 100644 --- a/packages/page-staking/src/Pools/Pools.tsx +++ b/packages/page-staking/src/Pools/Pools.tsx @@ -48,10 +48,11 @@ function Pools ({ className, ids, ownPools, params }: Props): React.ReactElement const header = useMemo(() => [ [t('pools'), 'start', 2], - [t('state')], + [t('state'), 'media--1100'], [t('points')], - [t('claimable'), 'media--1100'], - [t('members')] + [t('claimable'), 'media--1400'], + [undefined, 'media--1300'], + [undefined, 'media--1200'] ], [t]); const poolTypes = useRef([