diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 2da5b1ebe..73fabb021 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -2131,6 +2131,15 @@ "notifications11Title": { "message": "Scam and security risks" }, + "notifications12ActionText": { + "message": "Enable dark mode" + }, + "notifications12Description": { + "message": "Dark Mode will be enabled for new users depending on their system preferences. For existing users, enable Dark Mode manually under Settings -> Experimental." + }, + "notifications12Title": { + "message": "Wen dark mode? Now dark mode! 🕶️🦊" + }, "notifications1Description": { "message": "MetaMask Mobile users can now swap tokens inside their mobile wallet. Scan the QR code to get the mobile app and start swapping.", "description": "Description of a notification in the 'See What's New' popup. Describes the swapping on mobile feature." diff --git a/app/images/darkmode-banner.png b/app/images/darkmode-banner.png new file mode 100644 index 000000000..7f72b3128 Binary files /dev/null and b/app/images/darkmode-banner.png differ diff --git a/shared/notifications/index.js b/shared/notifications/index.js index 52e0662a4..65fc49fde 100644 --- a/shared/notifications/index.js +++ b/shared/notifications/index.js @@ -58,6 +58,14 @@ export const UI_NOTIFICATIONS = { id: 11, date: '2022-04-18', }, + 12: { + id: 12, + date: '2022-05-18', + image: { + src: 'images/darkmode-banner.png', + width: '100%', + }, + }, }; export const getTranslatedUINoficiations = (t, locale) => { @@ -165,5 +173,14 @@ export const getTranslatedUINoficiations = (t, locale) => { new Date(UI_NOTIFICATIONS[11].date), ), }, + 12: { + ...UI_NOTIFICATIONS[12], + title: t('notifications12Title'), + description: t('notifications12Description'), + actionText: t('notifications12ActionText'), + date: new Intl.DateTimeFormat(formattedLocale).format( + new Date(UI_NOTIFICATIONS[12].date), + ), + }, }; }; diff --git a/test/e2e/fixtures/address-entry/state.json b/test/e2e/fixtures/address-entry/state.json index 59da933e5..96b17cdb1 100644 --- a/test/e2e/fixtures/address-entry/state.json +++ b/test/e2e/fixtures/address-entry/state.json @@ -66,6 +66,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/connected-state/state.json b/test/e2e/fixtures/connected-state/state.json index ccc9ab82d..4d48df472 100644 --- a/test/e2e/fixtures/connected-state/state.json +++ b/test/e2e/fixtures/connected-state/state.json @@ -56,6 +56,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/custom-rpc/state.json b/test/e2e/fixtures/custom-rpc/state.json index 43319cd60..222eb0159 100644 --- a/test/e2e/fixtures/custom-rpc/state.json +++ b/test/e2e/fixtures/custom-rpc/state.json @@ -52,6 +52,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/custom-token/state.json b/test/e2e/fixtures/custom-token/state.json index da6098fcf..ae1fcd1b4 100644 --- a/test/e2e/fixtures/custom-token/state.json +++ b/test/e2e/fixtures/custom-token/state.json @@ -70,6 +70,9 @@ "notifications": { "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/eip-1559-v2-dapp/state.json b/test/e2e/fixtures/eip-1559-v2-dapp/state.json index 3e29d737e..839484240 100644 --- a/test/e2e/fixtures/eip-1559-v2-dapp/state.json +++ b/test/e2e/fixtures/eip-1559-v2-dapp/state.json @@ -53,6 +53,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/eip-1559-v2/state.json b/test/e2e/fixtures/eip-1559-v2/state.json index 452c896c3..0c79d8c61 100644 --- a/test/e2e/fixtures/eip-1559-v2/state.json +++ b/test/e2e/fixtures/eip-1559-v2/state.json @@ -53,6 +53,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/import-ui/state.json b/test/e2e/fixtures/import-ui/state.json index 75aa4e7da..20c6bf87c 100644 --- a/test/e2e/fixtures/import-ui/state.json +++ b/test/e2e/fixtures/import-ui/state.json @@ -107,6 +107,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/imported-account/state.json b/test/e2e/fixtures/imported-account/state.json index c6e2f4a8e..cb5c96950 100644 --- a/test/e2e/fixtures/imported-account/state.json +++ b/test/e2e/fixtures/imported-account/state.json @@ -52,6 +52,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/localization/state.json b/test/e2e/fixtures/localization/state.json index 952a3a502..4b32460b5 100644 --- a/test/e2e/fixtures/localization/state.json +++ b/test/e2e/fixtures/localization/state.json @@ -52,6 +52,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/metrics-enabled/state.json b/test/e2e/fixtures/metrics-enabled/state.json index 3b272611e..43b345204 100644 --- a/test/e2e/fixtures/metrics-enabled/state.json +++ b/test/e2e/fixtures/metrics-enabled/state.json @@ -56,6 +56,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/navigate-transactions/state.json b/test/e2e/fixtures/navigate-transactions/state.json index 6760e0d4f..963a846b4 100644 --- a/test/e2e/fixtures/navigate-transactions/state.json +++ b/test/e2e/fixtures/navigate-transactions/state.json @@ -52,6 +52,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/onboarding/state.json b/test/e2e/fixtures/onboarding/state.json index b0fbccd9a..6a4c94b96 100644 --- a/test/e2e/fixtures/onboarding/state.json +++ b/test/e2e/fixtures/onboarding/state.json @@ -26,6 +26,13 @@ }, "network": "1337" }, + "NotificationController": { + "notifications": { + "12": { + "isShown": true + } + } + }, "CurrencyController": { "conversionDate": 1617927806.941, "conversionRate": 2084.64, diff --git a/test/e2e/fixtures/send-edit-v2/state.json b/test/e2e/fixtures/send-edit-v2/state.json index fe1a4390c..9de073c00 100644 --- a/test/e2e/fixtures/send-edit-v2/state.json +++ b/test/e2e/fixtures/send-edit-v2/state.json @@ -53,6 +53,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/send-edit/state.json b/test/e2e/fixtures/send-edit/state.json index f538e00bf..1272fbd04 100644 --- a/test/e2e/fixtures/send-edit/state.json +++ b/test/e2e/fixtures/send-edit/state.json @@ -53,6 +53,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/test/e2e/fixtures/threebox-enabled/state.json b/test/e2e/fixtures/threebox-enabled/state.json index 565e8a122..78b6f1226 100644 --- a/test/e2e/fixtures/threebox-enabled/state.json +++ b/test/e2e/fixtures/threebox-enabled/state.json @@ -63,6 +63,9 @@ }, "8": { "isShown": true + }, + "12": { + "isShown": true } } }, diff --git a/ui/components/app/whats-new-popup/whats-new-popup.js b/ui/components/app/whats-new-popup/whats-new-popup.js index bba492040..4d47ee262 100644 --- a/ui/components/app/whats-new-popup/whats-new-popup.js +++ b/ui/components/app/whats-new-popup/whats-new-popup.js @@ -15,6 +15,7 @@ import { getSortedNotificationsToShow } from '../../../selectors'; import { BUILD_QUOTE_ROUTE, ADVANCED_ROUTE, + EXPERIMENTAL_ROUTE, } from '../../../helpers/constants/routes'; import { TYPOGRAPHY } from '../../../helpers/constants/design-system'; @@ -49,6 +50,10 @@ function getActionFunctionById(id, history) { updateViewedNotifications({ 10: true }); history.push(`${ADVANCED_ROUTE}#token-description`); }, + 12: () => { + updateViewedNotifications({ 12: true }); + history.push(EXPERIMENTAL_ROUTE); + }, }; return actionFunctions[id]; diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js index 270315831..4a232452e 100644 --- a/ui/selectors/selectors.js +++ b/ui/selectors/selectors.js @@ -728,6 +728,7 @@ function getAllowedNotificationIds(state) { 9: getIsMainnet(state), 10: Boolean(process.env.TOKEN_DETECTION_V2), 11: Boolean(process.env.TOKEN_DETECTION_V2), + 12: true, }; }