Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jpuri committed Jan 10, 2024
1 parent caea3ac commit 5246935
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
11 changes: 4 additions & 7 deletions app/_locales/en/messages.json

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

23 changes: 12 additions & 11 deletions shared/notifications/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const NOTIFICATION_DROP_LEDGER_FIREFOX = 25;
export const NOTIFICATION_OPEN_BETA_SNAPS = 26;
export const NOTIFICATION_BUY_SELL_BUTTON = 27;
export const NOTIFICATION_U2F_LEDGER_LIVE = 28;
export const NOTIFICATION_BLOCKAID_DEFAULT = 29;

export const UI_NOTIFICATIONS = {
1: {
Expand Down Expand Up @@ -171,8 +172,8 @@ export const UI_NOTIFICATIONS = {
date: null,
},
///: BEGIN:ONLY_INCLUDE_IF(blockaid)
29: {
id: 29,
[NOTIFICATION_BLOCKAID_DEFAULT]: {
id: Number(NOTIFICATION_BLOCKAID_DEFAULT),
date: null,
image: {
src: 'images/blockaid-security-provider.svg',
Expand Down Expand Up @@ -465,18 +466,18 @@ export const getTranslatedUINotifications = (t, locale) => {
: '',
},
///: BEGIN:ONLY_INCLUDE_IF(blockaid)
29: {
...UI_NOTIFICATIONS[29],
title: t('notifications29Title'),
[NOTIFICATION_BLOCKAID_DEFAULT]: {
...UI_NOTIFICATIONS[NOTIFICATION_BLOCKAID_DEFAULT],
title: t('notificationsBlockaidDefaultTitle'),
description: [
t('notifications29DescriptionOne'),
t('notifications29DescriptionTwo'),
t('notifications29DescriptionThree'),
t('notificationsBlockaidDefaultDescriptionOne'),
t('notificationsBlockaidDefaultDescriptionTwo'),
t('notificationsBlockaidDefaultDescriptionThree'),
],
actionText: t('notifications29ActionText'),
date: UI_NOTIFICATIONS[29].date
actionText: t('gotIt'),
date: UI_NOTIFICATIONS[NOTIFICATION_BLOCKAID_DEFAULT].date
? new Intl.DateTimeFormat(formattedLocale).format(
new Date(UI_NOTIFICATIONS[29].date),
new Date(UI_NOTIFICATIONS[NOTIFICATION_BLOCKAID_DEFAULT].date),
)
: '',
},
Expand Down
7 changes: 4 additions & 3 deletions ui/components/app/whats-new-popup/whats-new-popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
MetaMetricsEventName,
} from '../../../../shared/constants/metametrics';
import {
NOTIFICATION_BLOCKAID_DEFAULT,
NOTIFICATION_BUY_SELL_BUTTON,
NOTIFICATION_DROP_LEDGER_FIREFOX,
NOTIFICATION_OPEN_BETA_SNAPS,
Expand Down Expand Up @@ -126,8 +127,8 @@ function getActionFunctionById(id, history) {
updateViewedNotifications({ [NOTIFICATION_U2F_LEDGER_LIVE]: true });
},
///: BEGIN:ONLY_INCLUDE_IF(blockaid)
29: () => {
updateViewedNotifications({ 29: true });
[NOTIFICATION_BLOCKAID_DEFAULT]: () => {
updateViewedNotifications({ [NOTIFICATION_BLOCKAID_DEFAULT]: true });
},
///: END:ONLY_INCLUDE_IF
};
Expand Down Expand Up @@ -358,7 +359,7 @@ export default function WhatsNewPopup({ onClose }) {
[NOTIFICATION_BUY_SELL_BUTTON]: renderFirstNotification,
[NOTIFICATION_U2F_LEDGER_LIVE]: renderFirstNotification,
///: BEGIN:ONLY_INCLUDE_IF(blockaid)
29: renderFirstNotification,
[NOTIFICATION_BLOCKAID_DEFAULT]: renderFirstNotification,
///: END:ONLY_INCLUDE_IF
};

Expand Down
5 changes: 3 additions & 2 deletions ui/components/app/whats-new-popup/whats-new-popup.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { renderWithProvider } from '../../../../test/jest';
import configureStore from '../../../store/store';
import mockState from '../../../../test/data/mock-state.json';
import WhatsNewPopup from './whats-new-popup';
import { NOTIFICATION_BLOCKAID_DEFAULT } from '../../../../shared/notifications';

const render = () => {
const store = configureStore({
Expand Down Expand Up @@ -97,9 +98,9 @@ const render = () => {
id: 23,
isShown: false,
},
29: {
[NOTIFICATION_BLOCKAID_DEFAULT]: {
date: '2022-07-24',
id: 29,
id: Number(NOTIFICATION_BLOCKAID_DEFAULT),
isShown: false,
},
},
Expand Down
3 changes: 2 additions & 1 deletion ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ import {
} from '../../shared/modules/conversion.utils';
import { BackgroundColor } from '../helpers/constants/design-system';
import {
NOTIFICATION_BLOCKAID_DEFAULT,
NOTIFICATION_BUY_SELL_BUTTON,
NOTIFICATION_DROP_LEDGER_FIREFOX,
NOTIFICATION_OPEN_BETA_SNAPS,
Expand Down Expand Up @@ -1244,7 +1245,7 @@ function getAllowedAnnouncementIds(state) {
[NOTIFICATION_BUY_SELL_BUTTON]: true,
[NOTIFICATION_U2F_LEDGER_LIVE]: currentKeyringIsLedger && !isFirefox,
///: BEGIN:ONLY_INCLUDE_IF(blockaid)
29: true,
[NOTIFICATION_BLOCKAID_DEFAULT]: true,
///: END:ONLY_INCLUDE_IF
};
}
Expand Down

0 comments on commit 5246935

Please sign in to comment.