From e6a7a14492185434b936aa708fead7db185c6a81 Mon Sep 17 00:00:00 2001 From: aforaleka Date: Tue, 10 Sep 2024 13:52:36 -0400 Subject: [PATCH 1/2] add notif for incentives program ending --- package.json | 2 +- pnpm-lock.yaml | 8 ++++---- src/constants/notifications.ts | 5 ++--- src/hooks/useNotificationTypes.tsx | 17 +++++++++++++++++ 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 5db2603b5..1fc02432c 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "@datadog/browser-logs": "^5.23.3", "@dydxprotocol/v4-abacus": "1.9.10", "@dydxprotocol/v4-client-js": "^1.1.27", - "@dydxprotocol/v4-localization": "^1.1.190", + "@dydxprotocol/v4-localization": "^1.1.191", "@emotion/is-prop-valid": "^1.3.0", "@ethersproject/providers": "^5.7.2", "@hugocxl/react-to-image": "^0.0.9", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3b9d0fb05..e9c2607b2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -39,8 +39,8 @@ dependencies: specifier: ^1.1.27 version: 1.1.27 '@dydxprotocol/v4-localization': - specifier: ^1.1.190 - version: 1.1.190 + specifier: ^1.1.191 + version: 1.1.191 '@emotion/is-prop-valid': specifier: ^1.3.0 version: 1.3.0 @@ -3191,8 +3191,8 @@ packages: - utf-8-validate dev: false - /@dydxprotocol/v4-localization@1.1.190: - resolution: {integrity: sha512-J20EXyTeONwnSPgHkpdZHqA4rml80DlcIV5TK03dA1/AaPIXnvccUxw3GF84144AGiqYvUZKugu4/UAi5RRSWg==} + /@dydxprotocol/v4-localization@1.1.191: + resolution: {integrity: sha512-UOP9rH9drdIX1Q3nQ303jX+DzGqaasVBSMl8/xFLQmnFQN4Eb8zdUeQpdlvz4HbT761piGO8EGsnExm4Byww0Q==} dev: false /@dydxprotocol/v4-proto@5.0.0-dev.0: diff --git a/src/constants/notifications.ts b/src/constants/notifications.ts index 112280e2c..eab378d12 100644 --- a/src/constants/notifications.ts +++ b/src/constants/notifications.ts @@ -219,7 +219,7 @@ export type TransferNotifcation = { export enum ReleaseUpdateNotificationIds { DiscoveryProgram = 'discovery-program', Twitter200BVolume = 'twitter-200b-volume', - IncentivesS6 = 'incentives-s6', + IncentivesS6Ended = 'incentives-s6-ended', KeplrSupport = 'keplr-support', } @@ -228,9 +228,8 @@ export enum IncentivesDistributedNotificationIds { IncentivesDistributedS5 = 'incentives-distributed-s5', } -export const CURRENT_SEASON_NUMBER = 6; export const MEDIAN_REWARDS_AMOUNT = { DYDX: 52, USDC: 63 }; -export const INCENTIVES_SEASON_NOTIFICATION_ID = ReleaseUpdateNotificationIds.IncentivesS6; +export const INCENTIVES_SEASON_NOTIFICATION_ID = ReleaseUpdateNotificationIds.IncentivesS6Ended; export function getSeasonRewardDistributionNumber(seasonId: IncentivesDistributedNotificationIds) { switch (seasonId) { diff --git a/src/hooks/useNotificationTypes.tsx b/src/hooks/useNotificationTypes.tsx index 07ad58371..461d83051 100644 --- a/src/hooks/useNotificationTypes.tsx +++ b/src/hooks/useNotificationTypes.tsx @@ -377,6 +377,23 @@ export const notificationTypes: NotificationTypeConfig[] = [ const { dydxRewards } = data ?? {}; + useEffect(() => { + trigger( + INCENTIVES_SEASON_NOTIFICATION_ID, + { + icon: , + title: stringGetter({ + key: STRING_KEYS.INCENTIVES_SEASON_ENDED_TITLE, + params: { SEASON_NUMBER: 6 }, // last season, will just hardcode + }), + body: stringGetter({ key: STRING_KEYS.INCENTIVES_SEASON_ENDED_BODY }), + toastSensitivity: 'foreground', + groupKey: INCENTIVES_SEASON_NOTIFICATION_ID, + }, + [] + ); + }, [stringGetter]); + useEffect(() => { const rewards = dydxRewards ?? 0; if (dydxAddress && status === 'success' && rewards > 0) { From dec51ad217175dc6fdd17a78004c8df291974850 Mon Sep 17 00:00:00 2001 From: aforaleka Date: Tue, 10 Sep 2024 13:55:36 -0400 Subject: [PATCH 2/2] nit --- src/constants/notifications.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/constants/notifications.ts b/src/constants/notifications.ts index eab378d12..59b530fd1 100644 --- a/src/constants/notifications.ts +++ b/src/constants/notifications.ts @@ -228,7 +228,6 @@ export enum IncentivesDistributedNotificationIds { IncentivesDistributedS5 = 'incentives-distributed-s5', } -export const MEDIAN_REWARDS_AMOUNT = { DYDX: 52, USDC: 63 }; export const INCENTIVES_SEASON_NOTIFICATION_ID = ReleaseUpdateNotificationIds.IncentivesS6Ended; export function getSeasonRewardDistributionNumber(seasonId: IncentivesDistributedNotificationIds) {