diff --git a/packages/page-staking/src/Validators/Address/index.tsx b/packages/page-staking/src/Validators/Address/index.tsx index 45995af2ab..9d40313c11 100644 --- a/packages/page-staking/src/Validators/Address/index.tsx +++ b/packages/page-staking/src/Validators/Address/index.tsx @@ -11,12 +11,13 @@ import type { NominatorValue } from './types'; import React, { useMemo } from 'react'; import { ApiPromise } from '@polkadot/api'; -import { AddressSmall, Icon, LinkExternal, Table } from '@polkadot/react-components'; +import { AddressSmall, Columar, Icon, LinkExternal, Table } from '@polkadot/react-components'; import { checkVisibility } from '@polkadot/react-components/util'; -import { useApi, useCall, useDeriveAccountInfo } from '@polkadot/react-hooks'; +import { useApi, useCall, useDeriveAccountInfo, useToggle } from '@polkadot/react-hooks'; import { FormatBalance } from '@polkadot/react-query'; import { BN_ZERO } from '@polkadot/util'; +import { useTranslation } from '../../translate'; import NominatedBy from './NominatedBy'; import StakeOther from './StakeOther'; import Status from './Status'; @@ -90,7 +91,9 @@ function useAddressCalls (api: ApiPromise, address: string, isMain?: boolean) { } function Address ({ address, className = '', filterName, hasQueries, isElected, isFavorite, isMain, isPara, lastBlock, minCommission, nominatedBy, points, recentlyOnline, toggleFavorite, validatorInfo, withIdentity }: Props): React.ReactElement | null { + const { t } = useTranslation(); const { api } = useApi(); + const [isExpanded, toggleIsExpanded] = useToggle(false); const { accountInfo, slashingSpans } = useAddressCalls(api, address, isMain); const { commission, isChilled, nominators, stakeOther, stakeOwn } = useMemo( @@ -115,78 +118,111 @@ function Address ({ address, className = '', filterName, hasQueries, isElected, } return ( - - - - + + - - - - - {isMain - ? ( - + - ) - : ( - - ) - } - {isMain && ( - - {stakeOwn?.gtn(0) && ( - - )} - )} - - {commission} - - {isMain && ( - <> - - {points} - - - {lastBlock} - - - )} - - {hasQueries && ( - - + + + {isMain + ? ( + - + ) + : ( + + ) + } + + {commission} + + {isMain && ( + <> + + {points} + + + {lastBlock} + + )} - - - - - + + {isExpanded && ( + + + + + + {isMain && stakeOwn?.gtn(0) && ( + <> +
{t('own stake')}
+ + + )} +
+ + {hasQueries && ( + <> +
{t('graphs')}
+ + +  {t('historic results')} + + + )} +
+
+ + + + + + + + + )} + ); } diff --git a/packages/page-staking/src/Validators/CurrentList.tsx b/packages/page-staking/src/Validators/CurrentList.tsx index d184853739..c6c68701a4 100644 --- a/packages/page-staking/src/Validators/CurrentList.tsx +++ b/packages/page-staking/src/Validators/CurrentList.tsx @@ -144,18 +144,15 @@ function CurrentList ({ className, favorites, hasQueries, isIntentions, isOwn, m [t('intentions'), 'start', 3], [t('nominators'), 'expand'], [t('commission'), 'number'], - [], [] ] : [ [t('validators'), 'start', 3], [t('other stake'), 'expand'], - [t('own stake'), 'media--1100'], [t('commission')], [t('points')], [t('last #')], - [], - [undefined, 'media--1200'] + [] ] );