From 654ca50a22fa726411bd314a2c1c694f31fff87f Mon Sep 17 00:00:00 2001 From: Matthew Russell Date: Wed, 8 Nov 2023 23:32:51 -0800 Subject: [PATCH] feat: updates for disconnected state --- .../rewards-container/rewards-container.tsx | 42 ++++++++++++++----- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/apps/trading/components/rewards-container/rewards-container.tsx b/apps/trading/components/rewards-container/rewards-container.tsx index 4fcc9a2fc..743d0b804 100644 --- a/apps/trading/components/rewards-container/rewards-container.tsx +++ b/apps/trading/components/rewards-container/rewards-container.tsx @@ -80,6 +80,7 @@ export const RewardsContainer = () => { highlight={true} > { loading={loading} > { ); })} - + ['vestingBalancesSummary']; export type RewardPotProps = { + pubKey: string | null; accounts: Account[] | null; assetId: string; // VEGA vestingBalancesSummary: VestingBalances | undefined; }; export const RewardPot = ({ + pubKey, accounts, assetId, vestingBalancesSummary, @@ -204,6 +208,14 @@ export const RewardPot = ({ rewardAsset = vestingEntries[0].asset; } + if (!pubKey) { + return ( +
+

{t('Not connected')}

+
+ ); + } + return (
{rewardAsset ? ( @@ -273,7 +285,13 @@ export const RewardPot = ({ ); }; -export const Vesting = ({ baseRate }: { baseRate: string }) => { +export const Vesting = ({ + pubKey, + baseRate, +}: { + pubKey: string | null; + baseRate: string; +}) => { const baseRateFormatted = formatPercentage(Number(baseRate)); return (
@@ -283,14 +301,18 @@ export const Vesting = ({ baseRate }: { baseRate: string }) => { {t('Base rate')} {baseRateFormatted}% - - {t('Vesting multiplier')} - 0% - - - {t('Available to withdraw next epoch')} - 0 - + {pubKey && ( + <> + + {t('Vesting multiplier')} + 0% + + + {t('Available to withdraw next epoch')} + 0 + + + )}
);