From 66ab41528ae868765d05aa490203c7d93dfdbdd7 Mon Sep 17 00:00:00 2001 From: Ross Bulat Date: Sun, 22 Oct 2023 20:56:23 +0800 Subject: [PATCH] chore: tidy ups --- src/consts.ts | 2 +- src/contexts/Validators/ValidatorEntries/defaults.ts | 2 +- src/contexts/Validators/ValidatorEntries/index.tsx | 4 ++-- src/contexts/Validators/types.ts | 2 +- src/library/List/MotionContainer.tsx | 2 +- src/library/ListItem/Wrappers.ts | 4 ++-- src/library/ValidatorList/ValidatorItem/Pulse.tsx | 4 ++-- src/pages/Pools/Home/MembersList/Member.tsx | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/consts.ts b/src/consts.ts index 37eddf0039..2712aee007 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -54,7 +54,7 @@ export const FallbackEpochDuration = new BigNumber(2400); /* * Misc values */ -export const ListItemsPerPage = 50; +export const ListItemsPerPage = 30; export const ListItemsPerBatch = 30; export const MinBondPrecision = 3; export const MaxPayoutDays = 60; diff --git a/src/contexts/Validators/ValidatorEntries/defaults.ts b/src/contexts/Validators/ValidatorEntries/defaults.ts index 050f50a409..6624b6d499 100644 --- a/src/contexts/Validators/ValidatorEntries/defaults.ts +++ b/src/contexts/Validators/ValidatorEntries/defaults.ts @@ -7,7 +7,7 @@ import type { EraPointsBoundaries, ValidatorsContextInterface } from '../types'; export const defaultValidatorsContext: ValidatorsContextInterface = { fetchValidatorPrefs: async (a) => new Promise((resolve) => resolve(null)), - getValidatorEraPoints: (startEra, address) => ({}), + getValidatorPointsFromEras: (startEra, address) => ({}), getNominated: (bondFor) => [], injectValidatorListData: (entries) => [], validators: [], diff --git a/src/contexts/Validators/ValidatorEntries/index.tsx b/src/contexts/Validators/ValidatorEntries/index.tsx index df17eb5694..38a8918770 100644 --- a/src/contexts/Validators/ValidatorEntries/index.tsx +++ b/src/contexts/Validators/ValidatorEntries/index.tsx @@ -428,7 +428,7 @@ export const ValidatorsProvider = ({ }; // Gets era points for a validator - const getValidatorEraPoints = (startEra: BigNumber, address: string) => { + const getValidatorPointsFromEras = (startEra: BigNumber, address: string) => { startEra = BigNumber.max(startEra, 1); // minus 1 from `MaxRewardPointsEras` to account for the current era. @@ -573,7 +573,7 @@ export const ValidatorsProvider = ({ Promise; - getValidatorEraPoints: ( + getValidatorPointsFromEras: ( startEra: BigNumber, address: string ) => Record; diff --git a/src/library/List/MotionContainer.tsx b/src/library/List/MotionContainer.tsx index f7638b7fc9..a6facfc9be 100644 --- a/src/library/List/MotionContainer.tsx +++ b/src/library/List/MotionContainer.tsx @@ -6,7 +6,7 @@ import React from 'react'; export const MotionContainer = ({ children, - staggerChildren = 0.01, + staggerChildren = 0.015, }: { staggerChildren?: number; children: React.ReactNode; diff --git a/src/library/ListItem/Wrappers.ts b/src/library/ListItem/Wrappers.ts index 3fa47972ea..58c7dd2b52 100644 --- a/src/library/ListItem/Wrappers.ts +++ b/src/library/ListItem/Wrappers.ts @@ -9,8 +9,8 @@ export const Wrapper = styled.div` --height-top-row: 3.25rem; --height-bottom-row: 5rem; - /* Pool lists do not currently have larger bottom row. */ - &.pool { + &.pool, + &.member { --height-bottom-row: 2.75rem; } diff --git a/src/library/ValidatorList/ValidatorItem/Pulse.tsx b/src/library/ValidatorList/ValidatorItem/Pulse.tsx index 5b4e63ab4b..0a09b5e18e 100644 --- a/src/library/ValidatorList/ValidatorItem/Pulse.tsx +++ b/src/library/ValidatorList/ValidatorItem/Pulse.tsx @@ -21,10 +21,10 @@ export const Pulse = ({ address, displayFor }: PulseProps) => { const { isReady } = useApi(); const { activeEra } = useNetworkMetrics(); const { setTooltipTextAndOpen } = useTooltip(); - const { getValidatorEraPoints, eraPointsBoundaries, erasRewardPoints } = + const { getValidatorPointsFromEras, eraPointsBoundaries, erasRewardPoints } = useValidators(); const startEra = activeEra.index.minus(1); - const eraRewardPoints = getValidatorEraPoints(startEra, address); + const eraRewardPoints = getValidatorPointsFromEras(startEra, address); const high = eraPointsBoundaries?.high || new BigNumber(1); const normalisedPoints = normaliseEraPoints(eraRewardPoints, high); diff --git a/src/pages/Pools/Home/MembersList/Member.tsx b/src/pages/Pools/Home/MembersList/Member.tsx index 0704753fb0..08c9029f23 100644 --- a/src/pages/Pools/Home/MembersList/Member.tsx +++ b/src/pages/Pools/Home/MembersList/Member.tsx @@ -104,7 +104,7 @@ export const Member = ({ who, batchKey, batchIndex }: any) => { }; return ( - +