From 88d1806695e4158cde8c44ee59285b558396f71f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 10 Aug 2020 21:26:24 +0200 Subject: [PATCH] Small payout cleanups (#3384) --- packages/page-staking/src/Payouts/index.tsx | 3 ++- packages/page-staking/src/index.tsx | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/page-staking/src/Payouts/index.tsx b/packages/page-staking/src/Payouts/index.tsx index 665b3841e2..4cffb61abd 100644 --- a/packages/page-staking/src/Payouts/index.tsx +++ b/packages/page-staking/src/Payouts/index.tsx @@ -3,6 +3,7 @@ // of the Apache-2.0 license. See the LICENSE file for details. import { DeriveStakerReward } from '@polkadot/api-derive/types'; +import { StakerState } from '@polkadot/react-hooks/types'; import { PayoutStash, PayoutValidator } from './types'; import BN from 'bn.js'; @@ -24,7 +25,7 @@ import Validator from './Validator'; interface Props { className?: string; isInElection?: boolean; - stakerPayoutsAfter: BN; + ownValidators: StakerState; } interface Available { diff --git a/packages/page-staking/src/index.tsx b/packages/page-staking/src/index.tsx index 3dea393fc6..0b53324a64 100644 --- a/packages/page-staking/src/index.tsx +++ b/packages/page-staking/src/index.tsx @@ -4,6 +4,7 @@ import { DeriveStakingOverview } from '@polkadot/api-derive/types'; import { AppProps as Props } from '@polkadot/react-components/types'; +import { StakerState } from '@polkadot/react-hooks/types'; import { ElectionStatus } from '@polkadot/types/interfaces'; import React, { useEffect, useMemo, useState } from 'react'; @@ -38,6 +39,7 @@ function StakingApp ({ basePath, className = '' }: Props): React.ReactElement({}); + const [ownValidators, setOwnValidators] = useState([]); const [favorites, toggleFavorite] = useFavorites(STORE_FAVS_BASE); const allStashes = useStashIds(); const ownStashes = useOwnStashInfos(); @@ -104,6 +106,12 @@ function StakingApp ({ basePath, className = '' }: Props): React.ReactElement { + ownStashes && setOwnValidators( + ownStashes.filter(({ isStashValidating }) => isStashValidating) + ); + }, [ownStashes]); + return (
@@ -122,7 +130,10 @@ function StakingApp ({ basePath, className = '' }: Props): React.ReactElement - +