Skip to content

Commit

Permalink
chore(incentives): Update notification for incentives season 5 (#590)
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-onthelawn committed May 28, 2024
1 parent a4ef304 commit 31b29b0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@cosmjs/tendermint-rpc": "^0.32.1",
"@dydxprotocol/v4-abacus": "1.7.18",
"@dydxprotocol/v4-client-js": "^1.1.10",
"@dydxprotocol/v4-localization": "^1.1.86",
"@dydxprotocol/v4-localization": "^1.1.90",
"@ethersproject/providers": "^5.7.2",
"@js-joda/core": "^5.5.3",
"@privy-io/react-auth": "^1.59.7",
Expand Down
9 changes: 5 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/constants/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export type TransferNotifcation = {

export enum ReleaseUpdateNotificationIds {
RevampedConditionalOrders = 'revamped-conditional-orders',
IncentivesS4 = 'incentives-s4',
IncentivesS5 = 'incentives-s5',
IncentivesDistributedS3 = 'incentives-distributed-s3',
}

Expand Down
16 changes: 8 additions & 8 deletions src/hooks/useNotificationTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,31 +275,31 @@ export const notificationTypes: NotificationTypeConfig[] = [
const { chainTokenLabel } = useTokenConfigs();
const stringGetter = useStringGetter();

const incentivesExpirationDate = new Date('2024-05-09T23:59:59');
const incentivesExpirationDate = new Date('2024-07-17T23:59:59');
const conditionalOrdersExpirationDate = new Date('2024-06-01T23:59:59');

const currentDate = new Date();

useEffect(() => {
if (currentDate <= incentivesExpirationDate) {
trigger(
ReleaseUpdateNotificationIds.IncentivesS4,
ReleaseUpdateNotificationIds.IncentivesS5,
{
icon: <AssetIcon symbol={chainTokenLabel} />,
title: stringGetter({
key: 'NOTIFICATIONS.INCENTIVES_SEASON_BEGUN.TITLE',
params: { SEASON_NUMBER: '4' },
params: { SEASON_NUMBER: '5' },
}),
body: stringGetter({
key: 'NOTIFICATIONS.INCENTIVES_SEASON_BEGUN.BODY',
params: {
PREV_SEASON_NUMBER: '2',
DYDX_AMOUNT: '16',
USDC_AMOUNT: '50',
PREV_SEASON_NUMBER: '3',
DYDX_AMOUNT: '52',
USDC_AMOUNT: '100',
},
}),
toastSensitivity: 'foreground',
groupKey: ReleaseUpdateNotificationIds.IncentivesS4,
groupKey: ReleaseUpdateNotificationIds.IncentivesS5,
},
[]
);
Expand Down Expand Up @@ -372,7 +372,7 @@ export const notificationTypes: NotificationTypeConfig[] = [
const navigate = useNavigate();

return (notificationId: string) => {
if (notificationId === ReleaseUpdateNotificationIds.IncentivesS4) {
if (notificationId === ReleaseUpdateNotificationIds.IncentivesS5) {
navigate(`${chainTokenLabel}/${TokenRoute.TradingRewards}`);
} else if (notificationId === ReleaseUpdateNotificationIds.IncentivesDistributedS3) {
navigate(`${chainTokenLabel}/${TokenRoute.StakingRewards}`);
Expand Down

0 comments on commit 31b29b0

Please sign in to comment.