1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Revert "Adding "What's New" notification for Ledger Support Update (#11188)"

This reverts commit 939a34f16c.
This commit is contained in:
Dan Miller 2021-05-28 16:16:37 -02:30
parent 02b442aace
commit 7365f87f9e
11 changed files with 4 additions and 87 deletions

View File

@ -1270,22 +1270,6 @@
"message": "Stay secure",
"description": "Title for a notification in the 'See What's New' popup. Encourages users to consider security."
},
"notifications6DescriptionOne": {
"message": "As of Chrome version 91, the API that enabled our Ledger support (U2F) no longer supports hardware wallets. MetaMask has implemented a new Ledger Live support that allows you to continue to connect to your Ledger device via the Ledger Live desktop app.",
"description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update."
},
"notifications6DescriptionThree": {
"message": "When interacting with your Ledger account in MetaMask, a new tab will open and you will be asked to open the Ledger Live app. Once the app opens, you'll be asked to allow a WebSocket connection to your MetaMask account. That's all!",
"description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update."
},
"notifications6DescriptionTwo": {
"message": "You can enable Ledger Live support by clicking Settings > Advanced > Use Ledger Live.",
"description": "Description of a notification in the 'See What's New' popup. Describes the Ledger support update."
},
"notifications6Title": {
"message": "Ledger Support Update for Chrome Users",
"description": "Title for a notification in the 'See What's New' popup. Lets users know about the Ledger support update"
},
"ofTextNofM": {
"message": "of"
},

View File

@ -18,10 +18,6 @@ export const UI_NOTIFICATIONS = {
id: 3,
date: '2021-03-08',
},
6: {
id: 6,
date: '2021-05-26',
},
};
export const getTranslatedUINoficiations = (t, locale) => {
@ -53,17 +49,5 @@ export const getTranslatedUINoficiations = (t, locale) => {
new Date(UI_NOTIFICATIONS[3].date),
),
},
6: {
...UI_NOTIFICATIONS[6],
title: t('notifications6Title'),
description: [
t('notifications6DescriptionOne'),
t('notifications6DescriptionTwo'),
t('notifications6DescriptionThree'),
],
date: new Intl.DateTimeFormat(locale).format(
new Date(UI_NOTIFICATIONS[6].date),
),
},
};
};

View File

@ -60,9 +60,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -50,9 +50,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -101,9 +101,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -46,9 +46,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -46,9 +46,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -50,9 +50,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -47,9 +47,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -57,9 +57,6 @@
},
"3": {
"isShown": true
},
"6": {
"isShown": true
}
}
},

View File

@ -7,11 +7,9 @@ import { I18nContext } from '../../../contexts/i18n';
import { useEqualityCheck } from '../../../hooks/useEqualityCheck';
import Button from '../../ui/button';
import Popover from '../../ui/popover';
import Typography from '../../ui/typography';
import { updateViewedNotifications } from '../../../store/actions';
import { getTranslatedUINoficiations } from '../../../../../shared/notifications';
import { getSortedNotificationsToShow } from '../../../selectors';
import { TYPOGRAPHY } from '../../../helpers/constants/design-system';
function getActionFunctionById(id) {
const actionFunctions = {
@ -31,31 +29,6 @@ function getActionFunctionById(id) {
return actionFunctions[id];
}
const renderDescription = (description) => {
if (!Array.isArray(description)) {
return (
<Typography variant={TYPOGRAPHY.Paragraph}>{description}</Typography>
);
}
return (
<>
{description.map((piece, index) => {
const isLast = index === description.length - 1;
return (
<Typography
key={`item-${index}`}
variant={TYPOGRAPHY.Paragraph}
boxProps={{ marginBottom: isLast ? 0 : 2 }}
>
{piece}
</Typography>
);
})}
</>
);
};
const renderFirstNotification = (notification, idRefMap) => {
const { id, date, title, description, image, actionText } = notification;
const actionFunction = getActionFunctionById(id);
@ -73,14 +46,14 @@ const renderFirstNotification = (notification, idRefMap) => {
className={classnames(
'whats-new-popup__notification whats-new-popup__first-notification',
)}
key={`whats-new-popop-notification-${id}`}
key={`whats-new-popop-notificatiion-${id}`}
ref={idRefMap[id]}
>
{!placeImageBelowDescription && imageComponent}
<div className="whats-new-popup__notification-title">{title}</div>
<div className="whats-new-popup__description-and-date">
<div className="whats-new-popup__notification-description">
{renderDescription(description)}
{description}
</div>
<div className="whats-new-popup__notification-date">{date}</div>
</div>
@ -106,13 +79,13 @@ const renderSubsequentNotification = (notification, idRefMap) => {
return (
<div
className={classnames('whats-new-popup__notification')}
key={`whats-new-popop-notification-${id}`}
key={`whats-new-popop-notificatiion-${id}`}
ref={idRefMap[id]}
>
<div className="whats-new-popup__notification-title">{title}</div>
<div className="whats-new-popup__description-and-date">
<div className="whats-new-popup__notification-description">
{renderDescription(description)}
{description}
</div>
<div className="whats-new-popup__notification-date">{date}</div>
</div>