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

UX: Move Portfolio link to its own button (#17722)

This commit is contained in:
David Walsh 2023-02-21 09:32:08 -06:00 committed by GitHub
parent 0b296e88a5
commit 24e0a9030b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 277 additions and 337 deletions

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "MetaMask-Version"
},
"betaPortfolioSite": {
"message": "Beta-Portfolio-Seite"
},
"betaTerms": {
"message": "Beta-Nutzungsbedingungen"
},
@ -1717,9 +1714,6 @@
"message": "JSON Datei",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "um ihre Token und NFTs über Konten und Netzwerke hinweg im Auge behalten zu können."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Beliebte benutzerdefinierte Netzwerke"
},
"portfolioSite": {
"message": "Portfolio-Seite"
},
"preferredLedgerConnectionType": {
"message": "Bevorzugter Ledger-Verbindungstyp",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Erneut versuchen"
},
"tryOur": {
"message": "Probieren Sie unser"
},
"turnOnTokenDetection": {
"message": "Erweiterte Token-Erkennung aktivieren"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Δοκιμαστική έκδοση MetaMask"
},
"betaPortfolioSite": {
"message": "δοκιμαστική ιστοσελίδα χαρτοφυλακίου"
},
"betaTerms": {
"message": "Όροι Χρήσης της Δοκιμαστικής Έκδοσης"
},
@ -1717,9 +1714,6 @@
"message": "Αρχείο JSON",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "για να παρακολουθείτε τα token και τα NFT σε όλους τους λογαριασμούς και τα δίκτυα."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Δημοφιλή προσαρμοσμένα δίκτυα"
},
"portfolioSite": {
"message": "Ιστότοπος χαρτοφυλακίου"
},
"preferredLedgerConnectionType": {
"message": "Προτιμώμενος Τύπος Σύνδεσης Ledger",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Δοκιμάστε ξανά"
},
"tryOur": {
"message": "Δοκιμάστε το"
},
"turnOnTokenDetection": {
"message": "Ενεργοποιήστε την ενισχυμένη ανίχνευση token"
},

View File

@ -483,9 +483,6 @@
"betaMetamaskVersion": {
"message": "MetaMask Beta Version"
},
"betaPortfolioSite": {
"message": "beta portfolio site"
},
"betaTerms": {
"message": "Beta Terms of use"
},
@ -1772,9 +1769,6 @@
"message": "JSON File",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "to keep tabs on your tokens and NFTs across accounts and networks."
},
"keystone": {
"message": "Keystone"
},
@ -2809,8 +2803,8 @@
"popularCustomNetworks": {
"message": "Popular custom networks"
},
"portfolioSite": {
"message": "Portfolio site"
"portfolio": {
"message": "Portfolio"
},
"preferredLedgerConnectionType": {
"message": "Preferred Ledger connection type",
@ -4232,9 +4226,6 @@
"tryAgain": {
"message": "Try again"
},
"tryOur": {
"message": "Try our"
},
"turnOnTokenDetection": {
"message": "Turn on enhanced token detection"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Versión Beta de MetaMask"
},
"betaPortfolioSite": {
"message": "sitio de portafolio beta"
},
"betaTerms": {
"message": "Términos de uso de beta"
},
@ -1717,9 +1714,6 @@
"message": "Archivo JSON",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "para controlar sus tokens y NFT en todas las cuentas y redes."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Redes populares personalizadas"
},
"portfolioSite": {
"message": "Sitio del portafolio"
},
"preferredLedgerConnectionType": {
"message": "Tipo de conexión a Ledger preferida",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Vuelva a intentarlo"
},
"tryOur": {
"message": "Pruebe nuestro"
},
"turnOnTokenDetection": {
"message": "Activar la detección mejorada de tokens"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Version MetaMask Beta"
},
"betaPortfolioSite": {
"message": "site de portefeuille bêta"
},
"betaTerms": {
"message": "Conditions dutilisation de la version bêta"
},
@ -1717,9 +1714,6 @@
"message": "Fichier JSON",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "pour garder un œil sur vos jetons et vos NFT sur lensemble de vos comptes et réseaux."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Réseaux personnalisés populaires"
},
"portfolioSite": {
"message": "Site du portefeuille"
},
"preferredLedgerConnectionType": {
"message": "Type de connexion préférée au Ledger",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Réessayez"
},
"tryOur": {
"message": "Essayez notre"
},
"turnOnTokenDetection": {
"message": "Activer la détection améliorée des jetons"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "MetaMask बीटा संस्करण"
},
"betaPortfolioSite": {
"message": "बीटा पोर्टफोलियो साइट"
},
"betaTerms": {
"message": "बीटा के उपयोग की शर्तें"
},
@ -1717,9 +1714,6 @@
"message": "JSON फाइल",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "खातों और नेटवर्क पर अपने टोकन और एनएफटी पर नज़र रखने के लिए।"
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "लोकप्रिय कस्टम नेटवर्क"
},
"portfolioSite": {
"message": "पोर्टफोलियो साइट"
},
"preferredLedgerConnectionType": {
"message": "वरीयता वाले लेजर कनेक्शन के प्रकार",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "पुनः प्रयास करें"
},
"tryOur": {
"message": "हमारा आजमाएं"
},
"turnOnTokenDetection": {
"message": "उन्नत टोकन डिटेक्शन चालू करें"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Versi Beta MetaMask"
},
"betaPortfolioSite": {
"message": "situs portofolio beta"
},
"betaTerms": {
"message": "Syarat penggunaan Beta"
},
@ -1717,9 +1714,6 @@
"message": "File JSON",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "untuk mengawasi token dan NFT Anda di seluruh akun dan jaringan."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Jaringan khusus populer"
},
"portfolioSite": {
"message": "Situs portofolio"
},
"preferredLedgerConnectionType": {
"message": "Jenis koneksi Ledger Pilihan",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Coba lagi"
},
"tryOur": {
"message": "Cobalah"
},
"turnOnTokenDetection": {
"message": "Nyalakan deteksi token yang ditingkatkan"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "MetaMaskベータバージョン"
},
"betaPortfolioSite": {
"message": "ベータポートフォリオサイト"
},
"betaTerms": {
"message": "ベータ版利用規約"
},
@ -1717,9 +1714,6 @@
"message": "JSONファイル",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "複数のアカウントやネットワークのトークンや NFT を監視するには。"
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "人気のカスタムネットワーク"
},
"portfolioSite": {
"message": "ポートフォリオサイト"
},
"preferredLedgerConnectionType": {
"message": "優先Ledger接続タイプ",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "再試行"
},
"tryOur": {
"message": "こちらをお試しください:"
},
"turnOnTokenDetection": {
"message": "強化されたトークン検出をオンにする"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "MetaMask 베타 버전"
},
"betaPortfolioSite": {
"message": "베타 포트폴리오 사이트"
},
"betaTerms": {
"message": "베타 이용약관"
},
@ -1717,9 +1714,6 @@
"message": "JSON 파일",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "계정 및 네트워크 전반의 토큰과 NFT를 관리할 수 있습니다."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "인기 사용자 정의 네트워크"
},
"portfolioSite": {
"message": "포트폴리오 사이트"
},
"preferredLedgerConnectionType": {
"message": "선호하는 Ledger 연결 유형",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "다시 시도"
},
"tryOur": {
"message": "다음을 체험하기:"
},
"turnOnTokenDetection": {
"message": "향상된 토큰 감지 켜기"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Versão Beta da MetaMask"
},
"betaPortfolioSite": {
"message": "site de portfólio beta"
},
"betaTerms": {
"message": "Termos de uso do Beta"
},
@ -1717,9 +1714,6 @@
"message": "Ficheiro JSON",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "para manter o controle dos seus tokens e NFTs em diferentes contas e redes."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Redes personalizadas populares"
},
"portfolioSite": {
"message": "Site do portfólio"
},
"preferredLedgerConnectionType": {
"message": "Tipo de conexão preferencial com o Ledger",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Tente novamente"
},
"tryOur": {
"message": "Experimente nosso"
},
"turnOnTokenDetection": {
"message": "Ativar detecção avançada de token"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Бета-версия MetaMask"
},
"betaPortfolioSite": {
"message": "бета-версия сайта портфолио"
},
"betaTerms": {
"message": "Условия использования бета-версии"
},
@ -1717,9 +1714,6 @@
"message": "Файл JSON",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "чтобы следить за вашими токенами и NFT на разных счетах и в разных сетях."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Популярные пользовательские сети"
},
"portfolioSite": {
"message": "Сайт портфеля"
},
"preferredLedgerConnectionType": {
"message": "Предпочтительный тип подключения к леджеру",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Попробуйте еще раз"
},
"tryOur": {
"message": "Попробуйте наше"
},
"turnOnTokenDetection": {
"message": "Включите расширенное обнаружение токенов"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Bersyon ng MetaMask Beta"
},
"betaPortfolioSite": {
"message": "site ng beta portfolio"
},
"betaTerms": {
"message": "Mga tuntunin sa paggamit ng Beta"
},
@ -1717,9 +1714,6 @@
"message": "JSON File",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "upang masubaybayan ang iyong mga token at NFT sa mga account at network."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Mga sikat na custom na network"
},
"portfolioSite": {
"message": "Site ng portfolio"
},
"preferredLedgerConnectionType": {
"message": "Napiling Uri ng Ledger Connection",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Subukan ulit"
},
"tryOur": {
"message": "Subukan ang aming"
},
"turnOnTokenDetection": {
"message": "I-on ang pinahusay na pag-detect ng token"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "MetaMask Beta Sürümü"
},
"betaPortfolioSite": {
"message": "beta portföy sitesi"
},
"betaTerms": {
"message": "Beta Kullanım koşulları"
},
@ -1717,9 +1714,6 @@
"message": "JSON Dosyası",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "hesaplar ve ağlar arasında tokenlerinizin ve NFT'lerinizin sekmelerini korumak için."
},
"keystone": {
"message": "Ana İlke"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Popüler özel ağlar"
},
"portfolioSite": {
"message": "Portföy sitesi"
},
"preferredLedgerConnectionType": {
"message": "Tercih Edilen Kayıt Defteri bağlantı türü",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Tekrar dene"
},
"tryOur": {
"message": "Dene:"
},
"turnOnTokenDetection": {
"message": "Gelişmiş token algılamayıın"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "Phiên Bản MetaMask Beta"
},
"betaPortfolioSite": {
"message": "trang web danh mục đầu tư beta"
},
"betaTerms": {
"message": "Điều khoản Sử dụng Beta"
},
@ -1717,9 +1714,6 @@
"message": "Tập tin JSON",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "để giữ lại thẻ trên token và NFT của bạn trong các tài khoản và mạng."
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "Mạng tùy chỉnh phổ biến"
},
"portfolioSite": {
"message": "Trang web danh mục đầu tư"
},
"preferredLedgerConnectionType": {
"message": "Dạng kết nối Ledger ưu tiên",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "Thử lại"
},
"tryOur": {
"message": "Thử ngay"
},
"turnOnTokenDetection": {
"message": "Bật phát hiện token nâng cao"
},

View File

@ -479,9 +479,6 @@
"betaMetamaskVersion": {
"message": "MetaMask 测试版本"
},
"betaPortfolioSite": {
"message": "投资组合网站测试版"
},
"betaTerms": {
"message": "测试版使用条款"
},
@ -1717,9 +1714,6 @@
"message": "JSON 文件",
"description": "format for importing an account"
},
"keepTapsOnTokens": {
"message": "以记录您在各账户和各网络中的代币和NFT。"
},
"keystone": {
"message": "Keystone"
},
@ -2715,9 +2709,6 @@
"popularCustomNetworks": {
"message": "流行自定义网络"
},
"portfolioSite": {
"message": "投资组合网站"
},
"preferredLedgerConnectionType": {
"message": "首选 Ledger 连接类型",
"description": "A header for a dropdown in Settings > Advanced. Appears above the ledgerConnectionPreferenceDescription message"
@ -4090,9 +4081,6 @@
"tryAgain": {
"message": "重试"
},
"tryOur": {
"message": "试试我们的"
},
"turnOnTokenDetection": {
"message": "开启增强型代币检测"
},

View File

@ -40,7 +40,6 @@ export default class AppStateController extends EventEmitter {
outdatedBrowserWarningLastShown: new Date().getTime(),
nftsDetectionNoticeDismissed: false,
showTestnetMessageInDropdown: true,
showPortfolioTooltip: true,
showBetaHeader: isBeta(),
trezorModel: null,
...initState,
@ -302,15 +301,6 @@ export default class AppStateController extends EventEmitter {
this.store.updateState({ showTestnetMessageInDropdown });
}
/**
* Sets whether the portfolio site tooltip should be shown on the home page
*
* @param showPortfolioTooltip
*/
setShowPortfolioTooltip(showPortfolioTooltip) {
this.store.updateState({ showPortfolioTooltip });
}
/**
* Sets whether the beta notification heading on the home page
*

View File

@ -1927,8 +1927,6 @@ export default class MetamaskController extends EventEmitter {
appStateController.setShowTestnetMessageInDropdown.bind(
appStateController,
),
setShowPortfolioTooltip:
appStateController.setShowPortfolioTooltip.bind(appStateController),
setShowBetaHeader:
appStateController.setShowBetaHeader.bind(appStateController),
updateNftDropDownState:

View File

@ -0,0 +1,27 @@
import { cloneDeep } from 'lodash';
const version = 79;
/**
* The portfolio tooltip has been moved to a button on the home screen so
* this property is no longer needed in state
*/
export default {
version,
async migrate(originalVersionedData) {
const versionedData = cloneDeep(originalVersionedData);
versionedData.meta.version = version;
const state = versionedData.data;
const newState = transformState(state);
versionedData.data = newState;
return versionedData;
},
};
function transformState(state) {
if (state?.metamask?.showPortfolioTooltip !== undefined) {
delete state.metamask.showPortfolioTooltip;
}
return state;
}

View File

@ -0,0 +1,171 @@
import migration79 from './079';
describe('migration #79', () => {
it('should update the version metadata', async () => {
const oldStorage = {
meta: {
version: 78,
},
};
const newStorage = await migration79.migrate(oldStorage);
expect(newStorage.meta).toStrictEqual({
version: 79,
});
});
it('should remove the "showPortfolioToolip" property', async () => {
const oldStorage = {
meta: {
version: 78,
},
data: {
metamask: {
isInitialized: true,
isUnlocked: true,
isAccountMenuOpen: false,
identities: {
'0x00000': {
address: '0x00000',
lastSelected: 1675966229118,
name: 'Account 1',
},
'0x00001': {
address: '0x00001',
name: 'Account 2',
},
},
unapprovedTxs: {},
frequentRpcList: [],
addressBook: {},
popupGasPollTokens: [],
notificationGasPollTokens: [],
fullScreenGasPollTokens: [],
recoveryPhraseReminderHasBeenShown: false,
recoveryPhraseReminderLastShown: 1675966206345,
outdatedBrowserWarningLastShown: 1675966206345,
showTestnetMessageInDropdown: true,
showPortfolioTooltip: false,
showBetaHeader: false,
trezorModel: null,
qrHardware: {},
},
},
};
const newStorage = await migration79.migrate(oldStorage);
expect(newStorage).toStrictEqual({
meta: {
version: 79,
},
data: {
metamask: {
isInitialized: true,
isUnlocked: true,
isAccountMenuOpen: false,
identities: {
'0x00000': {
address: '0x00000',
lastSelected: 1675966229118,
name: 'Account 1',
},
'0x00001': {
address: '0x00001',
name: 'Account 2',
},
},
unapprovedTxs: {},
frequentRpcList: [],
addressBook: {},
popupGasPollTokens: [],
notificationGasPollTokens: [],
fullScreenGasPollTokens: [],
recoveryPhraseReminderHasBeenShown: false,
recoveryPhraseReminderLastShown: 1675966206345,
outdatedBrowserWarningLastShown: 1675966206345,
showTestnetMessageInDropdown: true,
showBetaHeader: false,
trezorModel: null,
qrHardware: {},
},
},
});
});
it('should make no changes if "showPortfolioToolip" never existed', async () => {
const oldStorage = {
meta: {
version: 78,
},
data: {
metamask: {
isInitialized: true,
isUnlocked: true,
isAccountMenuOpen: false,
identities: {
'0x00000': {
address: '0x00000',
lastSelected: 1675966229118,
name: 'Account 1',
},
'0x00001': {
address: '0x00001',
name: 'Account 2',
},
},
unapprovedTxs: {},
frequentRpcList: [],
addressBook: {},
popupGasPollTokens: [],
notificationGasPollTokens: [],
fullScreenGasPollTokens: [],
recoveryPhraseReminderHasBeenShown: false,
recoveryPhraseReminderLastShown: 1675966206345,
outdatedBrowserWarningLastShown: 1675966206345,
showTestnetMessageInDropdown: true,
showBetaHeader: false,
trezorModel: null,
qrHardware: {},
},
},
};
const newStorage = await migration79.migrate(oldStorage);
expect(newStorage).toStrictEqual({
meta: {
version: 79,
},
data: {
metamask: {
isInitialized: true,
isUnlocked: true,
isAccountMenuOpen: false,
identities: {
'0x00000': {
address: '0x00000',
lastSelected: 1675966229118,
name: 'Account 1',
},
'0x00001': {
address: '0x00001',
name: 'Account 2',
},
},
unapprovedTxs: {},
frequentRpcList: [],
addressBook: {},
popupGasPollTokens: [],
notificationGasPollTokens: [],
fullScreenGasPollTokens: [],
recoveryPhraseReminderHasBeenShown: false,
recoveryPhraseReminderLastShown: 1675966206345,
outdatedBrowserWarningLastShown: 1675966206345,
showTestnetMessageInDropdown: true,
showBetaHeader: false,
trezorModel: null,
qrHardware: {},
},
},
});
});
});

View File

@ -82,6 +82,7 @@ import m075 from './075';
import m076 from './076';
import m077 from './077';
import m078 from './078';
import m079 from './079';
const migrations = [
m002,
@ -161,6 +162,7 @@ const migrations = [
m076,
m077,
m078,
m079,
];
export default migrations;

View File

@ -125,7 +125,6 @@ function defaultFixture() {
recoveryPhraseReminderHasBeenShown: true,
recoveryPhraseReminderLastShown:
'__FIXTURE_SUBSTITUTION__currentDateInMilliseconds',
showPortfolioTooltip: false,
showTestnetMessageInDropdown: true,
trezorModel: null,
usedNetworks: {
@ -291,7 +290,6 @@ function onboardingFixture() {
recoveryPhraseReminderHasBeenShown: false,
recoveryPhraseReminderLastShown:
'__FIXTURE_SUBSTITUTION__currentDateInMilliseconds',
showPortfolioTooltip: true,
showTestnetMessageInDropdown: true,
trezorModel: null,
usedNetworks: {

View File

@ -27,7 +27,11 @@ import { setSwapsFromToken } from '../../../ducks/swaps/swaps';
import IconButton from '../../ui/icon-button';
import { isHardwareKeyring } from '../../../helpers/utils/hardware';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import { EVENT, EVENT_NAMES } from '../../../../shared/constants/metametrics';
import {
EVENT,
EVENT_NAMES,
CONTEXT_PROPS,
} from '../../../../shared/constants/metametrics';
import Spinner from '../../ui/spinner';
import { startNewDraftTransaction } from '../../../ducks/send';
import { AssetType } from '../../../../shared/constants/transaction';
@ -194,6 +198,35 @@ const EthOverview = ({ className }) => {
)
}
/>
<IconButton
className="eth-overview__button"
data-testid="home__portfolio-site"
Icon={
<Icon
name={ICON_NAMES.DIAGRAM}
color={IconColor.primaryInverse}
/>
}
label={t('portfolio')}
onClick={() => {
const portfolioUrl = process.env.PORTFOLIO_URL;
global.platform.openTab({
url: `${portfolioUrl}?metamaskEntry=ext`,
});
trackEvent(
{
category: EVENT.CATEGORIES.HOME,
event: EVENT_NAMES.PORTFOLIO_LINK_CLICKED,
properties: {
url: portfolioUrl,
},
},
{
contextPropsIntoEventProperties: [CONTEXT_PROPS.PAGE_TITLE],
},
);
}}
/>
</>
}
className={className}

View File

@ -82,9 +82,6 @@
color: var(--color-text-alternative);
}
&__button {
margin-right: 24px;
}
&__button:last-of-type {
margin-right: 0;
@ -128,10 +125,6 @@
color: var(--color-text-alternative);
}
&__button {
margin-right: 24px;
}
&__button:last-of-type {
margin-right: 0;
}

View File

@ -29,7 +29,11 @@ import IconButton from '../../ui/icon-button';
import { INVALID_ASSET_TYPE } from '../../../helpers/constants/error-keys';
import { showModal } from '../../../store/actions';
import { MetaMetricsContext } from '../../../contexts/metametrics';
import { EVENT, EVENT_NAMES } from '../../../../shared/constants/metametrics';
import {
EVENT,
EVENT_NAMES,
CONTEXT_PROPS,
} from '../../../../shared/constants/metametrics';
import { AssetType } from '../../../../shared/constants/transaction';
import DepositPopover from '../deposit-popover';
@ -222,6 +226,35 @@ const TokenOverview = ({ className, token }) => {
)
}
/>
<IconButton
className="eth-overview__button"
Icon={
<Icon
name={ICON_NAMES.DIAGRAM}
color={IconColor.primaryInverse}
/>
}
label={t('portfolio')}
data-testid="home__portfolio-site"
onClick={() => {
const portfolioUrl = process.env.PORTFOLIO_URL;
global.platform.openTab({
url: `${portfolioUrl}?metamaskEntry=ext`,
});
trackEvent(
{
category: EVENT.CATEGORIES.HOME,
event: EVENT_NAMES.PORTFOLIO_LINK_CLICKED,
properties: {
url: portfolioUrl,
},
},
{
contextPropsIntoEventProperties: [CONTEXT_PROPS.PAGE_TITLE],
},
);
}}
/>
</>
}
className={className}

View File

@ -4,6 +4,7 @@
align-items: center;
background-color: unset;
text-align: center;
width: 73px;
@include H7;

View File

@ -59,7 +59,6 @@ interface AppState {
newNetworkAdded: string;
newNftAddedMessage: string;
removeNftMessage: string;
portfolioTooltipWasShownInThisSession: boolean;
sendInputCurrencySwitched: boolean;
newTokensImported: string;
newCustomNetworkAdded: RPCDefinition | Record<string, any>;
@ -121,7 +120,6 @@ const initialState: AppState = {
newNetworkAdded: '',
newNftAddedMessage: '',
removeNftMessage: '',
portfolioTooltipWasShownInThisSession: false,
sendInputCurrencySwitched: false,
newTokensImported: '',
newCustomNetworkAdded: {},
@ -362,12 +360,6 @@ export default function reduceApp(
removeNftMessage: action.payload,
};
case actionConstants.PORTFOLIO_TOOLTIP_WAS_SHOWN_IN_THIS_SESSION:
return {
...appState,
portfolioTooltipWasShownInThisSession: true,
};
case actionConstants.SET_REQUEST_ACCOUNT_TABS:
return {
...appState,
@ -444,12 +436,6 @@ export function hideWhatsNewPopup(): Action {
};
}
export function setPortfolioTooltipWasShownInThisSession(): Action {
return {
type: actionConstants.PORTFOLIO_TOOLTIP_WAS_SHOWN_IN_THIS_SESSION,
};
}
export function toggleGasLoadingAnimation(
payload: boolean,
): PayloadAction<boolean> {
@ -510,9 +496,3 @@ export function getLedgerWebHidConnectedStatus(
export function getLedgerTransportStatus(state: AppSliceState): string | null {
return state.appState.ledgerTransportStatus;
}
export function getPortfolioTooltipWasShownInThisSession(
state: AppSliceState,
): boolean {
return state.appState.portfolioTooltipWasShownInThisSession;
}

View File

@ -1,11 +1,13 @@
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { Redirect, Route } from 'react-router-dom';
///: BEGIN:ONLY_INCLUDE_IN(main)
import {
EVENT,
EVENT_NAMES,
CONTEXT_PROPS,
} from '../../../shared/constants/metametrics';
///: END:ONLY_INCLUDE_IN
import AssetList from '../../components/app/asset-list';
import NftsTab from '../../components/app/nfts-tab';
import HomeNotification from '../../components/app/home-notification';
@ -27,13 +29,9 @@ import {
TypographyVariant,
FONT_WEIGHT,
DISPLAY,
BLOCK_SIZES,
Size,
TextVariant,
TextColor,
} from '../../helpers/constants/design-system';
import { SECOND } from '../../../shared/constants/time';
import { ButtonLink, ICON_NAMES } from '../../components/component-library';
import {
ASSET_ROUTE,
@ -51,7 +49,6 @@ import {
ONBOARDING_SECURE_YOUR_WALLET_ROUTE,
} from '../../helpers/constants/routes';
import ZENDESK_URLS from '../../helpers/constants/zendesk-url';
import Tooltip from '../../components/ui/tooltip';
///: BEGIN:ONLY_INCLUDE_IN(main)
import { SUPPORT_LINK } from '../../../shared/lib/ui-utils';
///: END:ONLY_INCLUDE_IN
@ -109,10 +106,6 @@ export default class Home extends PureComponent {
infuraBlocked: PropTypes.bool.isRequired,
showWhatsNewPopup: PropTypes.bool.isRequired,
hideWhatsNewPopup: PropTypes.func.isRequired,
showPortfolioTooltip: PropTypes.bool.isRequired,
hidePortfolioTooltip: PropTypes.func.isRequired,
portfolioTooltipWasShownInThisSession: PropTypes.bool.isRequired,
setPortfolioTooltipWasShownInThisSession: PropTypes.func.isRequired,
announcementsToShow: PropTypes.bool.isRequired,
///: BEGIN:ONLY_INCLUDE_IN(flask)
errorsToShow: PropTypes.object.isRequired,
@ -216,12 +209,7 @@ export default class Home extends PureComponent {
}
componentDidMount() {
const { setPortfolioTooltipWasShownInThisSession, showPortfolioTooltip } =
this.props;
this.checkStatusAndNavigate();
if (showPortfolioTooltip) {
setPortfolioTooltipWasShownInThisSession();
}
}
static getDerivedStateFromProps(props) {
@ -258,6 +246,7 @@ export default class Home extends PureComponent {
renderNotifications() {
const { t } = this.context;
const {
history,
shouldShowSeedPhraseReminder,
@ -618,14 +607,10 @@ export default class Home extends PureComponent {
announcementsToShow,
showWhatsNewPopup,
hideWhatsNewPopup,
showPortfolioTooltip,
hidePortfolioTooltip,
portfolioTooltipWasShownInThisSession,
seedPhraseBackedUp,
showRecoveryPhraseReminder,
firstTimeFlowType,
completedOnboarding,
shouldShowSeedPhraseReminder,
onboardedInThisUISession,
newCustomNetworkAdded,
} = this.props;
@ -641,8 +626,7 @@ export default class Home extends PureComponent {
(!onboardedInThisUISession || firstTimeFlowType === 'import') &&
announcementsToShow &&
showWhatsNewPopup &&
!showPortfolioTooltip &&
!portfolioTooltipWasShownInThisSession &&
!process.env.IN_TEST &&
Object.keys(newCustomNetworkAdded).length === 0;
return (
<div className="main-container">
@ -673,74 +657,6 @@ export default class Home extends PureComponent {
defaultActiveTabKey={defaultHomeActiveTabName}
onTabClick={onTabClick}
tabsClassName="home__tabs"
subHeader={
<Tooltip
position="bottom"
open={
!process.env.IN_TEST &&
!shouldShowSeedPhraseReminder &&
!showRecoveryPhraseReminder &&
showPortfolioTooltip
}
interactive
theme="home__subheader-link--tooltip"
html={
<div>
<div className="home__subheader-link--tooltip-content-header">
<div className="home__subheader-link--tooltip-content-header-text">
{t('new')}
</div>
<button
className="home__subheader-link--tooltip-content-header-button"
onClick={() => {
hidePortfolioTooltip();
}}
>
<i className="fa fa-times" />
</button>
</div>
<div>
{t('tryOur')}&nbsp;
<span className="home__subheader-link--tooltip-content-text-bold">
{t('betaPortfolioSite')}
</span>
&nbsp;{t('keepTapsOnTokens')}
</div>
</div>
}
>
<ButtonLink
className="home__subheader-link"
data-testid="home__portfolio-site"
onClick={async () => {
const portfolioUrl = process.env.PORTFOLIO_URL;
global.platform.openTab({
url: `${portfolioUrl}?metamaskEntry=ext`,
});
this.context.trackEvent(
{
category: EVENT.CATEGORIES.HOME,
event: EVENT_NAMES.PORTFOLIO_LINK_CLICKED,
properties: {
url: portfolioUrl,
},
},
{
contextPropsIntoEventProperties: [
CONTEXT_PROPS.PAGE_TITLE,
],
},
);
}}
iconName={ICON_NAMES.DIAGRAM}
width={BLOCK_SIZES.FULL}
size={Size.MD}
textProps={{ variant: TextVariant.bodySm }}
>
{t('portfolioSite')}
</ButtonLink>
</Tooltip>
}
>
<Tab
activeClassName="home__tab--active"
@ -774,7 +690,7 @@ export default class Home extends PureComponent {
activeClassName="home__tab--active"
className="home__tab"
data-testid="home__activity-tab"
name={this.context.t('activity')}
name={t('activity')}
tabKey="activity"
>
<TransactionList />

View File

@ -23,14 +23,12 @@ import {
hasUnsignedQRHardwareMessage,
getNewNftAddedMessage,
getNewTokensImported,
getShowPortfolioTooltip,
getShouldShowSeedPhraseReminder,
getRemoveNftMessage,
} from '../../selectors';
import {
closeNotificationPopup,
hidePortfolioTooltip,
setConnectedStatusPopoverHasBeenShown,
setDefaultHomeActiveTabName,
setWeb3ShimUsageAlertDismissed,
@ -50,8 +48,6 @@ import {
import {
hideWhatsNewPopup,
setNewCustomNetworkAdded,
getPortfolioTooltipWasShownInThisSession,
setPortfolioTooltipWasShownInThisSession,
} from '../../ducks/app/app';
import { getWeb3ShimUsageAlertEnabledness } from '../../ducks/metamask/metamask';
import { getSwapsFeatureIsLive } from '../../ducks/swaps/swaps';
@ -142,9 +138,6 @@ const mapStateToProps = (state) => {
shouldShowErrors: Object.entries(metamask.snapErrors || []).length > 0,
///: END:ONLY_INCLUDE_IN
showWhatsNewPopup: getShowWhatsNewPopup(state),
showPortfolioTooltip: getShowPortfolioTooltip(state),
portfolioTooltipWasShownInThisSession:
getPortfolioTooltipWasShownInThisSession(state),
showRecoveryPhraseReminder: getShowRecoveryPhraseReminder(state),
showOutdatedBrowserWarning:
getIsBrowserDeprecated() && getShowOutdatedBrowserWarning(state),
@ -172,7 +165,6 @@ const mapDispatchToProps = (dispatch) => ({
disableWeb3ShimUsageAlert: () =>
setAlertEnabledness(AlertTypes.web3ShimUsage, false),
hideWhatsNewPopup: () => dispatch(hideWhatsNewPopup()),
hidePortfolioTooltip,
setRecoveryPhraseReminderHasBeenShown: () =>
dispatch(setRecoveryPhraseReminderHasBeenShown()),
setRecoveryPhraseReminderLastShown: (lastShown) =>
@ -199,8 +191,6 @@ const mapDispatchToProps = (dispatch) => ({
setRpcTarget: (rpcUrl, chainId, ticker, nickname) => {
dispatch(setRpcTarget(rpcUrl, chainId, ticker, nickname));
},
setPortfolioTooltipWasShownInThisSession: () =>
dispatch(setPortfolioTooltipWasShownInThisSession()),
});
export default compose(

View File

@ -110,7 +110,6 @@ export default class Routes extends Component {
isTestNet: PropTypes.bool,
currentChainId: PropTypes.string,
shouldShowSeedPhraseReminder: PropTypes.bool,
portfolioTooltipIsBeingShown: PropTypes.bool,
forgottenPassword: PropTypes.bool,
isCurrentProviderCustom: PropTypes.bool,
completedOnboarding: PropTypes.bool,
@ -369,7 +368,6 @@ export default class Routes extends Component {
isTestNet,
currentChainId,
shouldShowSeedPhraseReminder,
portfolioTooltipIsBeingShown,
isCurrentProviderCustom,
completedOnboarding,
} = this.props;
@ -392,8 +390,7 @@ export default class Routes extends Component {
const shouldShowNetworkDeprecationWarning =
windowType !== ENVIRONMENT_TYPE_NOTIFICATION &&
isUnlocked &&
!shouldShowSeedPhraseReminder &&
!portfolioTooltipIsBeingShown;
!shouldShowSeedPhraseReminder;
return (
<div

View File

@ -11,7 +11,6 @@ import {
getIsTestnet,
getCurrentChainId,
getShouldShowSeedPhraseReminder,
getShowPortfolioTooltip,
isCurrentProviderCustom,
} from '../../selectors';
import {
@ -53,7 +52,6 @@ function mapStateToProps(state) {
isTestNet: getIsTestnet(state),
currentChainId: getCurrentChainId(state),
shouldShowSeedPhraseReminder: getShouldShowSeedPhraseReminder(state),
portfolioTooltipIsBeingShown: getShowPortfolioTooltip(state),
forgottenPassword: state.metamask.forgottenPassword,
isCurrentProviderCustom: isCurrentProviderCustom(state),
completedOnboarding,

View File

@ -1071,10 +1071,6 @@ export function getShowOutdatedBrowserWarning(state) {
return currentTime - outdatedBrowserWarningLastShown >= DAY * 2;
}
export function getShowPortfolioTooltip(state) {
return state.metamask.showPortfolioTooltip;
}
export function getShowBetaHeader(state) {
return state.metamask.showBetaHeader;
}

View File

@ -90,8 +90,6 @@ export const SET_OPEN_METAMASK_TAB_IDS = 'SET_OPEN_METAMASK_TAB_IDS';
// Home Screen
export const HIDE_WHATS_NEW_POPUP = 'HIDE_WHATS_NEW_POPUP';
export const PORTFOLIO_TOOLTIP_WAS_SHOWN_IN_THIS_SESSION =
'PORTFOLIO_TOOLTIP_WAS_SHOWN_IN_THIS_SESSION';
export const TOGGLE_GAS_LOADING_ANIMATION = 'TOGGLE_GAS_LOADING_ANIMATION';
// Smart Transactions

View File

@ -4488,10 +4488,6 @@ export function hideTestNetMessage() {
return submitRequestToBackground('setShowTestnetMessageInDropdown', [false]);
}
export function hidePortfolioTooltip() {
return submitRequestToBackground('setShowPortfolioTooltip', [false]);
}
export function hideBetaHeader() {
return submitRequestToBackground('setShowBetaHeader', [false]);
}