Skip to content

Commit

Permalink
Added "What's New" Notification for Improved token allowance experience
Browse files Browse the repository at this point in the history
  • Loading branch information
adnansahovic committed Nov 11, 2022
1 parent 9821c59 commit 546cb46
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 3 deletions.
9 changes: 9 additions & 0 deletions app/_locales/en/messages.json

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

15 changes: 15 additions & 0 deletions shared/notifications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ export const UI_NOTIFICATIONS = {
id: 15,
date: '2022-09-15',
},
16: {
id: 16,
date: null,
},
};

export const getTranslatedUINotifications = (t, locale) => {
Expand Down Expand Up @@ -224,5 +228,16 @@ export const getTranslatedUINotifications = (t, locale) => {
)
: '',
},
16: {
...UI_NOTIFICATIONS[16],
title: t('notifications16Title'),
description: t('notifications16Description'),
actionText: t('notifications16ActionText'),
date: UI_NOTIFICATIONS[16].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[16].date),
)
: '',
},
};
};
4 changes: 4 additions & 0 deletions ui/components/app/whats-new-popup/whats-new-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ function getActionFunctionById(id, history) {
updateViewedNotifications({ 14: true });
history.push(`${ADVANCED_ROUTE}#backup-userdata`);
},
16: () => {
updateViewedNotifications({ 16: true });
history.push(EXPERIMENTAL_ROUTE);
},
};

return actionFunctions[id];
Expand Down
7 changes: 4 additions & 3 deletions ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -956,12 +956,13 @@ function getAllowedAnnouncementIds(state) {
7: false,
8: supportsWebHid && currentKeyringIsLedger && currentlyUsingLedgerLive,
9: false,
10: true,
11: true,
10: false,
11: false,
12: false,
13: false,
14: false,
15: true,
15: false,
16: true,
};
}

Expand Down

0 comments on commit 546cb46

Please sign in to comment.