From f8490a6924745c75d2666c5297418bed70de6e52 Mon Sep 17 00:00:00 2001 From: Jaco Date: Sat, 22 May 2021 08:19:18 +0300 Subject: [PATCH] Hide para indicator on non relays (#5344) --- packages/page-staking/src/Legend.tsx | 19 +++++++++------- .../src/Overview/Address/Status.tsx | 22 ++++++++++--------- .../src/Overview/Address/index.tsx | 1 + .../page-staking/src/Overview/CurrentList.tsx | 2 +- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/packages/page-staking/src/Legend.tsx b/packages/page-staking/src/Legend.tsx index f9ab96dba7..f000fde3db 100644 --- a/packages/page-staking/src/Legend.tsx +++ b/packages/page-staking/src/Legend.tsx @@ -10,9 +10,10 @@ import { useTranslation } from './translate'; interface Props { className?: string; + isRelay?: boolean; } -function Legend ({ className }: Props): React.ReactElement { +function Legend ({ className, isRelay }: Props): React.ReactElement { const { t } = useTranslation(); return ( @@ -24,13 +25,15 @@ function Legend ({ className }: Props): React.ReactElement { /> {t('Next session')} - - - {t('Para validator')} - + {isRelay && ( + + + {t('Para validator')} + + )} { +function Status ({ isElected, isMain, isPara, isRelay, nominators = NO_NOMS, onlineCount, onlineMessage }: Props): React.ReactElement { const { allAccounts } = useAccounts(); const blockCount = onlineCount && onlineCount.toNumber(); @@ -40,15 +41,16 @@ function Status ({ isElected, isMain, isPara, nominators = NO_NOMS, onlineCount, ) : } - {isPara - ? ( - - ) - : - } + {isRelay && ( + isPara + ? ( + + ) + : + )} {isElected ? ( } header={headerActiveRef.current} - legend={} + legend={} > {isLoading ? undefined : _renderRows(validators, true)}