From 57093ddca70a755af17e2cf93801e64d19657d2d Mon Sep 17 00:00:00 2001 From: NidhiKJha Date: Thu, 14 Sep 2023 16:14:34 +0530 Subject: [PATCH] added updated menu for settings --- app/_locales/en/messages.json | 16 +++++++++------- .../connected-sites-list.component.js | 9 +++++++++ 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index 857317ab1798..ebe439fab4fd 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -795,18 +795,15 @@ "connectWithMetaMask": { "message": "Connect with MetaMask" }, + "connectedAccountsAndSnapDescription": { + "message": "$1 account and $2 snap connected to this site:" + }, "connectedAccountsDescriptionPlural": { "message": "You have $1 accounts connected to this site.", "description": "$1 is the number of accounts" }, "connectedAccountsDescriptionSingular": { "message": "You have 1 account connected to this site." - }, - "connectedAccountsAndSnapDescription": { - "message": "$1 account and $2 snap connected to this site:" - }, - "connectedSnapAndNoAccountDescription": { - "message": "MetaMask is connected to this site, but no accounts are connected yet" }, "connectedAccountsEmptyDescription": { "message": "MetaMask is not connected to this site. To connect to a web3 site, find and click the connect button." @@ -822,6 +819,9 @@ "message": "$1 is not connected to any sites.", "description": "$1 is the account name" }, + "connectedSnapAndNoAccountDescription": { + "message": "MetaMask is connected to this site, but no accounts are connected yet" + }, "connecting": { "message": "Connecting..." }, @@ -1066,7 +1066,6 @@ "customTokenWarningInTokenDetectionNetworkWithTDOFF": { "message": "Make sure you trust a token before you import it. Learn how to avoid $1. You can also enable token detection $2." }, - "customerSupport": { "message": "customer support" }, @@ -4132,6 +4131,9 @@ "message": "Consensys has no access to information you share with Third Party Services.", "description": "Third part of a message in popup modal displayed when installing a snap for the first time." }, + "snapsSettings": { + "message": "Snaps settings" + }, "snapsSettingsDescription": { "message": "Manage your Snaps" }, diff --git a/ui/components/app/connected-sites-list/connected-sites-list.component.js b/ui/components/app/connected-sites-list/connected-sites-list.component.js index d2c867c91410..74149d7417f2 100644 --- a/ui/components/app/connected-sites-list/connected-sites-list.component.js +++ b/ui/components/app/connected-sites-list/connected-sites-list.component.js @@ -1,11 +1,13 @@ import React, { useRef, useState } from 'react'; import PropTypes from 'prop-types'; +import { useHistory } from 'react-router-dom'; import { AvatarFavicon, ButtonIcon, IconName } from '../../component-library'; import { stripHttpsSchemeWithoutPort } from '../../../helpers/utils/util'; import SiteOrigin from '../../ui/site-origin'; import { BorderColor, Size } from '../../../helpers/constants/design-system'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { Menu, MenuItem } from '../../ui/menu'; +import { SNAPS_LIST_ROUTE } from '../../../helpers/constants/routes'; export default function ConnectedSitesList({ connectedSubjects, @@ -14,6 +16,7 @@ export default function ConnectedSitesList({ const [showOptions, setShowOptions] = useState(false); const ref = useRef(false); const t = useI18nContext(); + const history = useHistory(); const getSubjectDisplayName = (subject) => { if (subject.extensionId) { @@ -65,6 +68,12 @@ export default function ConnectedSitesList({ > {t('disconnect')} + history.push(SNAPS_LIST_ROUTE)} + > + {t('snapsSettings')} + ) : null}