From 69b5321f3d0a080823227f89ceba5ca203c3ea06 Mon Sep 17 00:00:00 2001 From: Radu Mojic Date: Tue, 23 Apr 2024 18:15:21 +0300 Subject: [PATCH] fix staking details on SC --- .../AccountStaking/AccountStaking.tsx | 2 +- .../components/DonutChart/DonutChart.tsx | 34 +++++++++++-------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/pages/AccountDetails/AccountStaking/AccountStaking.tsx b/src/pages/AccountDetails/AccountStaking/AccountStaking.tsx index 918d8cb55..7b8c6b686 100644 --- a/src/pages/AccountDetails/AccountStaking/AccountStaking.tsx +++ b/src/pages/AccountDetails/AccountStaking/AccountStaking.tsx @@ -44,7 +44,7 @@ export const AccountStaking = () => { ) : []; - const needsData = address && stakingDataReady && address !== stateAddress; + const needsData = address && address !== stateAddress; const hasStaking = showDelegation || showDelegationLegacy || showStake; const isReady = providerDataReady && diff --git a/src/pages/AccountDetails/AccountStaking/components/DonutChart/DonutChart.tsx b/src/pages/AccountDetails/AccountStaking/components/DonutChart/DonutChart.tsx index a012f6bb6..a3a47e994 100644 --- a/src/pages/AccountDetails/AccountStaking/components/DonutChart/DonutChart.tsx +++ b/src/pages/AccountDetails/AccountStaking/components/DonutChart/DonutChart.tsx @@ -29,25 +29,31 @@ export const DonutChart = ({ } ]; + const hasNoActiveStake = bNtotalLocked.isEqualTo(0); + return ( <>
- {bNtotalLocked.isEqualTo(0) ? 'No staking' : 'Total Staked'} + {hasNoActiveStake ? 'No staking' : 'Total Staked'}
-
- -
-
- -
+ {!hasNoActiveStake && ( + <> +
+ +
+
+ +
+ + )}