From 024a55e3d0240b638b31b048083152f6fd77f966 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 7 Oct 2019 15:27:43 +0200 Subject: [PATCH] Fix nominate display, add commission display (#1703) * Fix nominating display, Closes https://github.com/polkadot-js/apps/issues/1701 * Add commission display on staking overview --- packages/app-staking/src/Actions/Account/index.tsx | 2 +- packages/app-staking/src/Overview/Address.tsx | 3 ++- packages/react-components/src/AddressInfo.tsx | 9 ++------- packages/react-components/src/AddressRow.tsx | 8 +++++--- 4 files changed, 10 insertions(+), 12 deletions(-) diff --git a/packages/app-staking/src/Actions/Account/index.tsx b/packages/app-staking/src/Actions/Account/index.tsx index e6a7f80199..cb032a6714 100644 --- a/packages/app-staking/src/Actions/Account/index.tsx +++ b/packages/app-staking/src/Actions/Account/index.tsx @@ -208,7 +208,7 @@ class Account extends React.PureComponent { withValidatorPrefs={isStashValidating} /> - {nominees && nominees.length && ( + {nominees && nominees.length !== 0 && (
{nominees.map((nomineeId, index): React.ReactNode => ( diff --git a/packages/app-staking/src/Overview/Address.tsx b/packages/app-staking/src/Overview/Address.tsx index 7ec25781f3..e9e7089ff4 100644 --- a/packages/app-staking/src/Overview/Address.tsx +++ b/packages/app-staking/src/Overview/Address.tsx @@ -132,8 +132,9 @@ class Address extends React.PureComponent { key={stashId || controllerId || undefined} value={stashId || address} withBalance={{ bonded }} + withValidatorPrefs={{ validatorPayment: true }} > - {nominators.length && ( + {nominators.length !== 0 && (
{t('Nominators ({{count}})', { diff --git a/packages/react-components/src/AddressInfo.tsx b/packages/react-components/src/AddressInfo.tsx index 54294f2d0c..5ae8571426 100644 --- a/packages/react-components/src/AddressInfo.tsx +++ b/packages/react-components/src/AddressInfo.tsx @@ -154,10 +154,9 @@ function renderValidatorPrefs ({ staking_info, t, withValidatorPrefs = false }: return null; } - // start with a spacer return ( <> -
+
{validatorPrefsDisplay.unstakeThreshold && (staking_info.validatorPrefs as ValidatorPrefs0to145).unstakeThreshold && ( <>
);