From 4d1c18fec59f39eadd57c5bcf55e9c5c80230e41 Mon Sep 17 00:00:00 2001 From: Thibaut Sardan <33178835+Tbaut@users.noreply.github.com> Date: Fri, 14 Aug 2020 20:12:00 +0200 Subject: [PATCH] Add info about the nominators state (#3420) * add info about the nominators state * Apply suggestions from code review * remove duplicated info * Apply suggestions from code review Co-authored-by: Jaco Greeff --- .../src/Actions/Account/ListNominees.tsx | 20 +++++++++++++++---- packages/page-staking/src/md/basic.md | 7 ------- packages/react-components/src/Expander.tsx | 5 ++++- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/packages/page-staking/src/Actions/Account/ListNominees.tsx b/packages/page-staking/src/Actions/Account/ListNominees.tsx index 492f3a65a6..91c22e88e6 100644 --- a/packages/page-staking/src/Actions/Account/ListNominees.tsx +++ b/packages/page-staking/src/Actions/Account/ListNominees.tsx @@ -20,7 +20,10 @@ function ListNominees ({ nominating, stashId }: Props): React.ReactElement {nomsActive && nomsActive.length !== 0 && ( - ('Active nominations ({{count}})', { replace: { count: nomsActive.length } })}> + ('The validators selected by the Phragmen algorithm to nominate for this era.')} + summary={t('Active nominations ({{count}})', { replace: { count: nomsActive.length } })} + > {nomsActive.map((nomineeId, index): React.ReactNode => ( )} {nomsInactive && nomsInactive.length !== 0 && ( - ('Inactive nominations ({{count}})', { replace: { count: nomsInactive.length } })}> + ('The elected validator list that did not get selected by the Phragmen algorithm for this era. However they may be selected in the future.')} + summary={t('Inactive nominations ({{count}})', { replace: { count: nomsInactive.length } })} + > {nomsInactive.map((nomineeId, index): React.ReactNode => ( )} {nomsChilled && nomsChilled.length !== 0 && ( - ('Renomination required ({{count}})', { replace: { count: nomsChilled.length } })}> + ('The validators that got slashed and for which your nomination got auto-chilled. Re-nominating these will make them available to the Phragmen algorithm.')} + summary={t('Renomination required ({{count}})', { replace: { count: nomsChilled.length } })} + > {nomsChilled.map((nomineeId, index): React.ReactNode => ( )} {nomsWaiting && nomsWaiting.length !== 0 && ( - ('Waiting nominations ({{count}})', { replace: { count: nomsWaiting.length } })}> + ('The validators that are not in the validator set because they need more nominations or because they have willingly stop validating. Any nominations made before the next election will also appear here.')} + summary={t('Waiting nominations ({{count}})', { replace: { count: nomsWaiting.length } })} + > {nomsWaiting.map((nomineeId, index): React.ReactNode => ( { +function Expander ({ children, className = '', help, isOpen, summary, summaryMeta, summarySub, withDot, withHidden }: Props): React.ReactElement { const { t } = useTranslation(); const [isExpanded, toggleExpanded] = useToggle(isOpen); const headerMain = useMemo( @@ -63,6 +65,7 @@ function Expander ({ children, className = '', isOpen, summary, summaryMeta, sum onClick={toggleExpanded} >
+ {help && } {hasContent ? : withDot