From 5172d1e117437097797d80ec7e99acc78101f8d9 Mon Sep 17 00:00:00 2001 From: Aleka Cheung Date: Tue, 30 Jan 2024 16:08:54 -0500 Subject: [PATCH] add reward history tooltip --- src/constants/localization.ts | 4 ++-- src/constants/tooltips/trade.ts | 3 +++ src/pages/rewards/RewardHistoryPanel.tsx | 6 +++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/constants/localization.ts b/src/constants/localization.ts index 5ff02b2..a3639b1 100644 --- a/src/constants/localization.ts +++ b/src/constants/localization.ts @@ -95,8 +95,8 @@ export type TooltipStrings = { stringParams?: any; urlConfigs?: LinksConfigs; }) => { - title: string; - body: string; + title?: string; + body?: string; learnMoreLink?: string; }; }; diff --git a/src/constants/tooltips/trade.ts b/src/constants/tooltips/trade.ts index 081e3f0..4382ce8 100644 --- a/src/constants/tooltips/trade.ts +++ b/src/constants/tooltips/trade.ts @@ -198,4 +198,7 @@ export const tradeTooltips: TooltipStrings = { title: stringGetter({ key: TOOLTIP_STRING_KEYS.UNREALIZED_PNL_TITLE }), body: stringGetter({ key: TOOLTIP_STRING_KEYS.UNREALIZED_PNL_BODY }), }), + 'reward-history': ({ stringGetter }) => ({ + body: stringGetter({ key: TOOLTIP_STRING_KEYS.REWARD_HISTORY_BODY }), + }), } as const; diff --git a/src/pages/rewards/RewardHistoryPanel.tsx b/src/pages/rewards/RewardHistoryPanel.tsx index 51fc70c..f6cd73c 100644 --- a/src/pages/rewards/RewardHistoryPanel.tsx +++ b/src/pages/rewards/RewardHistoryPanel.tsx @@ -18,6 +18,7 @@ import { ToggleGroup } from '@/components/ToggleGroup'; import { TradingRewardHistoryTable } from '@/views/tables/TradingRewardHistoryTable'; import abacusStateManager from '@/lib/abacus'; +import { WithTooltip } from '@/components/WithTooltip'; export const RewardHistoryPanel = () => { const stringGetter = useStringGetter(); @@ -43,7 +44,9 @@ export const RewardHistoryPanel = () => { slotHeader={ -

{stringGetter({ key: STRING_KEYS.REWARD_HISTORY })}

+ +

{stringGetter({ key: STRING_KEYS.REWARD_HISTORY })}

+
{stringGetter({ key: STRING_KEYS.REWARD_HISTORY_DESCRIPTION })}