1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Remove new address alert (#14811)

* Removing new address alert

* remove unused copy

* fix broken e2e test

* rework layout nesting

* satisfy lint

* change layout to fix firefox tests

* change selector specificity on e2e test

* revert test change after fix has been merged from develop

* fix linting

Co-authored-by: Brad Decker <bhdecker84@gmail.com>
Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
This commit is contained in:
ryanml 2022-12-08 07:20:24 -07:00 committed by GitHub
parent c9b42fc966
commit a759d427f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
60 changed files with 29 additions and 379 deletions

View File

@ -546,9 +546,6 @@
"newAccount": {
"message": "አዲስ መለያ"
},
"newAccountDetectedDialogMessage": {
"message": "አዲስ አድራሻ ተገኝቷል! ወደ አድራሻ ደብተርዎ ለማከለ እዚህ ላይ ጠቅ ያድርጉ።"
},
"newAccountNumberName": {
"message": "መለያ$1",
"description": "Default name of next account to be created on create account screen"

View File

@ -562,9 +562,6 @@
"newAccount": {
"message": "حساب جديد"
},
"newAccountDetectedDialogMessage": {
"message": "تم اكتشاف عنوان جديد! انقر هنا لإضافته إلى دفتر عناوينك."
},
"newAccountNumberName": {
"message": "حساب $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -557,9 +557,6 @@
"newAccount": {
"message": "Нов акаунт"
},
"newAccountDetectedDialogMessage": {
"message": "Открит е нов адрес! Кликнете тук, за да го добавите към вашата адресна книга."
},
"newAccountNumberName": {
"message": "Акаунт $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -561,9 +561,6 @@
"newAccount": {
"message": "নতুন আ্যাকাউন্ট"
},
"newAccountDetectedDialogMessage": {
"message": "নতুন ঠিকানা সনাক্ত করা হয়েছে। আপনার অ্যাড্রেস বুকে যোগ করতে এখানে ক্লিক করুন।"
},
"newAccountNumberName": {
"message": "অ্যাকাউন্ট $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -545,9 +545,6 @@
"newAccount": {
"message": "Nou compte"
},
"newAccountDetectedDialogMessage": {
"message": "Nova adreça detectada! Clica aquí per afegir la teva llibreta d'adreces."
},
"newAccountNumberName": {
"message": "Compte $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -545,9 +545,6 @@
"newAccount": {
"message": "Ny konto"
},
"newAccountDetectedDialogMessage": {
"message": "Ny adresse fundet! Klik her for at tilføje til din adressebog."
},
"newAccountNumberName": {
"message": "Konto $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Neues Konto"
},
"newAccountDetectedDialogMessage": {
"message": "Neue Adresse erkannt! Klicken Sie hier, um sie zu Ihrem Adressbuch hinzuzufügen."
},
"newAccountNumberName": {
"message": "Konto $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Νέος Λογαριασμός"
},
"newAccountDetectedDialogMessage": {
"message": "Εντοπίστηκε νέα διεύθυνση! Κάντε κλικ εδώ για να την προσθέσετε στο βιβλίο διευθύνσεών σας."
},
"newAccountNumberName": {
"message": "Λογαριασμός $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2252,9 +2252,6 @@
"newAccount": {
"message": "New account"
},
"newAccountDetectedDialogMessage": {
"message": "New address detected! Click here to add to your address book."
},
"newAccountNumberName": {
"message": "Account $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Cuenta nueva"
},
"newAccountDetectedDialogMessage": {
"message": "Se detectó una dirección nueva. Haga clic aquí para agregarla a la libreta de direcciones."
},
"newAccountNumberName": {
"message": "Cuenta $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -1688,9 +1688,6 @@
"newAccount": {
"message": "Cuenta nueva"
},
"newAccountDetectedDialogMessage": {
"message": "Se detectó una dirección nueva. Haga clic aquí para agregarla a la libreta de direcciones."
},
"newAccountNumberName": {
"message": "Cuenta $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -551,9 +551,6 @@
"newAccount": {
"message": "Uus konto"
},
"newAccountDetectedDialogMessage": {
"message": "Leiti uus aadress! Klõpsake siia, et see oma aadressiraamatusse lisada."
},
"newAccountNumberName": {
"message": "Konto $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -561,9 +561,6 @@
"newAccount": {
"message": "حساب جدید"
},
"newAccountDetectedDialogMessage": {
"message": "آدرس جدید شناسایی شد! اینجا کلیک کنید تا به کتابچه آدرسهای شما اضافه شود."
},
"newAccountNumberName": {
"message": "حساب 1$1",
"description": "Default name of next account to be created on create account screen"

View File

@ -561,9 +561,6 @@
"newAccount": {
"message": "Uusi tili"
},
"newAccountDetectedDialogMessage": {
"message": "Uusi osoitettu tunnistettu! Lisää se osoitekirjaasi napsauttamalla tästä."
},
"newAccountNumberName": {
"message": "Tili $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -502,9 +502,6 @@
"newAccount": {
"message": "Bagong Account"
},
"newAccountDetectedDialogMessage": {
"message": "Naka-detect ng bagong address! Mag-click dito para idagdag ang iyong address book."
},
"newContact": {
"message": "Bagong Contact"
},

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Nouveau compte"
},
"newAccountDetectedDialogMessage": {
"message": "Nouvelle adresse détectée ! Cliquez ici pour ajouter à votre carnet dadresses."
},
"newAccountNumberName": {
"message": "Compte $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -558,9 +558,6 @@
"newAccount": {
"message": "חשבון חדש"
},
"newAccountDetectedDialogMessage": {
"message": "זוהתה כתובת חדש! נא להקיש כאן כדי להוסיף לפנקס הכתובות שלך."
},
"newAccountNumberName": {
"message": "חשבון $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "नया खाता"
},
"newAccountDetectedDialogMessage": {
"message": "नया पता मिला है! अपनी पता पुस्तिका में जोड़ने के लिए यहां क्लिक करें।"
},
"newAccountNumberName": {
"message": "खाता $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -554,9 +554,6 @@
"newAccount": {
"message": "Novi račun"
},
"newAccountDetectedDialogMessage": {
"message": "Nova je adresa otkrivena! Ovdje kliknite za njezino dodavanje u vaš imenik."
},
"newAccountNumberName": {
"message": "Račun $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -554,9 +554,6 @@
"newAccount": {
"message": "Új fiók"
},
"newAccountDetectedDialogMessage": {
"message": "Új címet észleltünk! Kattints ide, ha szeretnéd feljegyezni címtáradba."
},
"newAccountNumberName": {
"message": "$1 fiók",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Akun baru"
},
"newAccountDetectedDialogMessage": {
"message": "Alamat baru terdeteksi! Klik di sini untuk menambahkan ke buku alamat Anda."
},
"newAccountNumberName": {
"message": "Akun $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -1440,9 +1440,6 @@
"newAccount": {
"message": "Nuovo Account"
},
"newAccountDetectedDialogMessage": {
"message": "Rilevato un nuovo indirizzo! Clicca qui per aggiungerlo alla tua rubrica."
},
"newContact": {
"message": "Nuovo contatto"
},

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "新しいアカウント"
},
"newAccountDetectedDialogMessage": {
"message": "新しいアドレスが検出されました! アドレス帳に追加するにはここをクリックしてください。"
},
"newAccountNumberName": {
"message": "アカウント$1",
"description": "Default name of next account to be created on create account screen"

View File

@ -561,9 +561,6 @@
"newAccount": {
"message": "ಹೊಸ ಖಾತೆ"
},
"newAccountDetectedDialogMessage": {
"message": "ಹೊಸ ವಿಳಾಸ ಪತ್ತೆಯಾಗಿದೆ! ನಿಮ್ಮ ವಿಳಾಸ ಪುಸ್ತಕಕ್ಕೆ ಸೇರಿಸಲು ಇಲ್ಲಿ ಕ್ಲಿಕ್ ಮಾಡಿ."
},
"newAccountNumberName": {
"message": "ಖಾತೆ $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "새 계정"
},
"newAccountDetectedDialogMessage": {
"message": "새 주소가 발견되었습니다! 여기를 클릭하여 주소록에 추가하세요."
},
"newAccountNumberName": {
"message": "계정 $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -561,9 +561,6 @@
"newAccount": {
"message": "Nauja paskyra"
},
"newAccountDetectedDialogMessage": {
"message": "Aptiktas naujas adresas! Spustelėkite čia, kad įtrauktumėte į savo adresų knygelę."
},
"newAccountNumberName": {
"message": "Paskyra $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -557,9 +557,6 @@
"newAccount": {
"message": "Jauns konts"
},
"newAccountDetectedDialogMessage": {
"message": "Konstatēta jauna adrese. Klikšķiniet šeit, lai pievienotu to adrešu grāmatai."
},
"newAccountNumberName": {
"message": "Konts $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -544,9 +544,6 @@
"newAccount": {
"message": "Akaun Baru"
},
"newAccountDetectedDialogMessage": {
"message": "Alamat baru dikesan! Klik di sini untuk menambah buku alamat anda."
},
"newAccountNumberName": {
"message": "Akaun $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -548,9 +548,6 @@
"newAccount": {
"message": "Ny konto "
},
"newAccountDetectedDialogMessage": {
"message": "Ny adresse oppdaget! Klikk her for å legge til adresseboken din."
},
"newAccountNumberName": {
"message": "Konto $1 ",
"description": "Default name of next account to be created on create account screen"

View File

@ -1072,9 +1072,6 @@
"newAccount": {
"message": "Bagong Account"
},
"newAccountDetectedDialogMessage": {
"message": "May natukoy na bagong address! Mag-click dito para idagdag sa iyong address book."
},
"newAccountNumberName": {
"message": "Account $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -558,9 +558,6 @@
"newAccount": {
"message": "Nowe konto"
},
"newAccountDetectedDialogMessage": {
"message": "Wykryto nowy adres! Kliknij tutaj, aby dodać go do książki adresowej."
},
"newAccountNumberName": {
"message": "Konto $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Nova conta"
},
"newAccountDetectedDialogMessage": {
"message": "Novo endereço detectado! Clique aqui para adicionar à sua agenda de endereços."
},
"newAccountNumberName": {
"message": "Conta $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -1672,9 +1672,6 @@
"newAccount": {
"message": "Nova conta"
},
"newAccountDetectedDialogMessage": {
"message": "Novo endereço detectado! Clique aqui para adicionar à sua agenda de endereços."
},
"newAccountNumberName": {
"message": "Conta $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -548,9 +548,6 @@
"newAccount": {
"message": "Cont nou"
},
"newAccountDetectedDialogMessage": {
"message": "A fost detectată o adresă nouă! Faceți clic aici pentru a o adăuga în agenda dvs."
},
"newAccountNumberName": {
"message": "Cont $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Новый счет"
},
"newAccountDetectedDialogMessage": {
"message": "Обнаружен новый адрес! Нажмите здесь, чтобы добавить этот адрес в свою адресную книгу."
},
"newAccountNumberName": {
"message": "Счет $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -536,9 +536,6 @@
"newAccount": {
"message": "Nový účet"
},
"newAccountDetectedDialogMessage": {
"message": "Bola zistená nová adresa! Kliknite sem a pridajte ju do svojho adresára."
},
"newAccountNumberName": {
"message": "Účet $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -549,9 +549,6 @@
"newAccount": {
"message": "Nov račun"
},
"newAccountDetectedDialogMessage": {
"message": "Zaznan je nov naslov! Kliknite tukaj, da ga dodate v svoj imenik."
},
"newAccountNumberName": {
"message": "Račun $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -552,9 +552,6 @@
"newAccount": {
"message": "Nov nalog"
},
"newAccountDetectedDialogMessage": {
"message": "Otkrivena je nova adresa! Kliknite ovde da biste je dodali u Vaš adresar."
},
"newAccountNumberName": {
"message": "Nalog $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -545,9 +545,6 @@
"newAccount": {
"message": "Nytt konto"
},
"newAccountDetectedDialogMessage": {
"message": "Ny adress upptäckt! Klicka här för att lägga till i din adressbok."
},
"newAccountNumberName": {
"message": "Konto $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -539,9 +539,6 @@
"newAccount": {
"message": "Akaunti Mpya"
},
"newAccountDetectedDialogMessage": {
"message": "Anwani mpya zimegunduliwa! Bofya hapa ili uongeze kitabu chako cha anwani."
},
"newAccountNumberName": {
"message": "Akaunti $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -290,9 +290,6 @@
"newAccount": {
"message": "บัญชีใหม่"
},
"newAccountDetectedDialogMessage": {
"message": "ตรวจพบที่อยู่ใหม่! คลิกที่นี่เพื่อเพิ่มลงในสมุดที่อยู่ของคุณ"
},
"newAccountNumberName": {
"message": "บัญชี $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Bagong Account"
},
"newAccountDetectedDialogMessage": {
"message": "May natukoy na bagong address! Mag-click dito para idagdag sa iyong address book."
},
"newAccountNumberName": {
"message": "Account $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Yeni Hesap"
},
"newAccountDetectedDialogMessage": {
"message": "Yeni adres algılandı! Adres defterinize eklemek için buraya tıklayın."
},
"newAccountNumberName": {
"message": "Hesap $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -561,9 +561,6 @@
"newAccount": {
"message": "Новий обліковий запис"
},
"newAccountDetectedDialogMessage": {
"message": "Виявлено нову адресу! Клацніть тут, щоб додати її до вашої адресної книги."
},
"newAccountNumberName": {
"message": "Обліковий запис $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "Tài khoản mới"
},
"newAccountDetectedDialogMessage": {
"message": "Đã tìm thấy địa chỉ mới! Nhấn vào đây để thêm địa chỉ này vào sổ địa chỉ của bạn."
},
"newAccountNumberName": {
"message": "Tài khoản $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -2128,9 +2128,6 @@
"newAccount": {
"message": "新账户"
},
"newAccountDetectedDialogMessage": {
"message": "检测到新地址!点击这里以添加到您的地址簿。"
},
"newAccountNumberName": {
"message": "账户 $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -1035,9 +1035,6 @@
"newAccount": {
"message": "新帳戶"
},
"newAccountDetectedDialogMessage": {
"message": "偵測到新位址!點擊此處將其新增到你的位址簿。"
},
"newAccountNumberName": {
"message": "帳戶 $1",
"description": "Default name of next account to be created on create account screen"

View File

@ -12,69 +12,6 @@ describe('Address Book', function () {
},
],
};
it('Adds an entry to the address book and sends eth to that address', async function () {
await withFixtures(
{
fixtures: new FixtureBuilder().build(),
ganacheOptions,
title: this.test.title,
},
async ({ driver }) => {
await driver.navigate();
await driver.fill('#password', 'correct horse battery staple');
await driver.press('#password', driver.Key.ENTER);
await driver.clickElement('[data-testid="eth-overview-send"]');
await driver.fill(
'input[placeholder="Search, public address (0x), or ENS"]',
'0x2f318C334780961FB129D2a6c30D0763d9a5C970',
);
await driver.clickElement('.dialog.send__dialog.dialog--message');
// wait for address book modal to be visible
const addressModal = await driver.findElement('.nickname-popover');
await driver.clickElement('.nickname-popover__footer-button');
await driver.findElement('.update-nickname__wrapper');
await driver.fill(
'.update-nickname__content__text-field input',
'Test Name 1',
);
await driver.clickElement('.update-nickname__save');
// wait for address book modal to be removed from DOM
await addressModal.waitForElementState('hidden');
const inputAmount = await driver.findElement('.unit-input__input');
await inputAmount.fill('1');
const inputValue = await inputAmount.getProperty('value');
assert.equal(inputValue, '1');
await driver.clickElement({ text: 'Next', tag: 'button' });
await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.clickElement('[data-testid="home__activity-tab"]');
await driver.wait(async () => {
const confirmedTxes = await driver.findElements(
'.transaction-list__completed-transactions .transaction-list-item',
);
return confirmedTxes.length === 1;
}, 10000);
await driver.waitForSelector(
{
css: '.transaction-list-item__primary-currency',
text: '-1 ETH',
},
{ timeout: 10000 },
);
},
);
});
it('Sends to an address book entry', async function () {
await withFixtures(
{

View File

@ -82,10 +82,6 @@ describe('Deploy contract and call contract methods', function () {
'MetaMask Notification',
windowHandles,
);
await driver.waitForSelector({
css: '.confirm-page-container-summary__action__name',
text: 'Deposit',
});
await driver.clickElement({ text: 'Confirm', tag: 'button' });
await driver.waitUntilXWindowHandles(2);
await driver.switchToWindow(extension);

View File

@ -47,7 +47,9 @@ describe('Editing Confirm Transaction', function () {
text: 'sec',
tag: 'span',
});
await driver.clickElement('[data-testid="edit-gas-fee-item-high"]');
await driver.clickElement(
'[data-testid="edit-gas-fee-item-high"] > span:first-child',
);
await driver.waitForSelector({ text: '🦍' });
await driver.waitForSelector({
text: 'Aggressive',
@ -55,7 +57,9 @@ describe('Editing Confirm Transaction', function () {
// update estimates to medium
await driver.clickElement('[data-testid="edit-gas-fee-button"]');
await driver.clickElement('[data-testid="edit-gas-fee-item-medium"]');
await driver.clickElement(
'[data-testid="edit-gas-fee-item-medium"] > span:first-child',
);
await driver.waitForSelector({ text: '🦊' });
await driver.waitForSelector({
text: 'Market',
@ -63,7 +67,9 @@ describe('Editing Confirm Transaction', function () {
// update estimates to low
await driver.clickElement('[data-testid="edit-gas-fee-button"]');
await driver.clickElement('[data-testid="edit-gas-fee-item-low"]');
await driver.clickElement(
'[data-testid="edit-gas-fee-item-low"] > span:first-child',
);
await driver.waitForSelector({ text: '🐢' });
await driver.waitForSelector({
text: 'Low',

View File

@ -44,12 +44,6 @@ describe('Send ETH from inside MetaMask using default gas', function () {
await inputAmount.press(driver.Key.BACK_SPACE);
await inputAmount.press(driver.Key.BACK_SPACE);
await inputAmount.press(driver.Key.BACK_SPACE);
await driver.wait(async () => {
const sendDialogMsgs = await driver.findElements(
'.send-v2__form div.dialog',
);
return sendDialogMsgs.length === 1;
}, 10000);
await driver.assertElementNotPresent('.send-v2__error-amount');

View File

@ -41,12 +41,6 @@ describe('Send ETH to a 40 character hexadecimal address', function () {
css: '.ens-input__selected-input__title',
text: hexPrefixedAddress,
});
await driver.wait(async () => {
const sendDialogMsgs = await driver.findElements(
'.send-v2__form div.dialog',
);
return sendDialogMsgs.length === 1;
}, 10000);
await driver.clickElement({ text: 'Next', tag: 'button' });
// Confirm transaction
@ -92,12 +86,6 @@ describe('Send ETH to a 40 character hexadecimal address', function () {
css: '.ens-input__selected-input__title',
text: hexPrefixedAddress,
});
await driver.wait(async () => {
const sendDialogMsgs = await driver.findElements(
'.send-v2__form div.dialog',
);
return sendDialogMsgs.length === 1;
}, 10000);
await driver.clickElement({ text: 'Next', tag: 'button' });
// Confirm transaction
@ -187,12 +175,6 @@ describe('Send ERC20 to a 40 character hexadecimal address', function () {
css: '.ens-input__selected-input__title',
text: hexPrefixedAddress,
});
await driver.wait(async () => {
const sendDialogMsgs = await driver.findElements(
'.send-v2__form div.dialog',
);
return sendDialogMsgs.length === 1;
}, 10000);
await driver.delay(2000);
await driver.clickElement({ text: 'Next', tag: 'button' });
@ -277,12 +259,6 @@ describe('Send ERC20 to a 40 character hexadecimal address', function () {
css: '.ens-input__selected-input__title',
text: hexPrefixedAddress,
});
await driver.wait(async () => {
const sendDialogMsgs = await driver.findElements(
'.send-v2__form div.dialog',
);
return sendDialogMsgs.length === 1;
}, 10000);
await driver.delay(2000);
await driver.clickElement({ text: 'Next', tag: 'button' });

View File

@ -104,13 +104,6 @@ describe('Confirm Page Container Container Test', () => {
expect(recipientName).toBeInTheDocument();
});
it('should render add address to address book dialog', () => {
const newAccountDetectDialog = screen.queryByText(
/New address detected!/u,
);
expect(newAccountDetectDialog).toBeInTheDocument();
});
it('should simulate click reject button', () => {
const rejectButton = screen.getByTestId('page-container-footer-cancel');
fireEvent.click(rejectButton);

View File

@ -12,13 +12,10 @@ import {
import { NETWORK_TO_NAME_MAP } from '../../../../shared/constants/network';
import { PageContainerFooter } from '../../ui/page-container';
import Dialog from '../../ui/dialog';
import Button from '../../ui/button';
import ActionableMessage from '../../ui/actionable-message/actionable-message';
import SenderToRecipient from '../../ui/sender-to-recipient';
import NicknamePopovers from '../modals/nickname-popovers';
import AdvancedGasFeePopover from '../advanced-gas-fee-popover';
import EditGasFeePopover from '../edit-gas-fee-popover/edit-gas-fee-popover';
import EditGasPopover from '../edit-gas-popover';
@ -40,7 +37,6 @@ import {
export default class ConfirmPageContainer extends Component {
state = {
showNicknamePopovers: false,
setShowDepositPopover: false,
collectionBalance: 0,
};
@ -110,8 +106,6 @@ export default class ConfirmPageContainer extends Component {
handleCloseEditGas: PropTypes.func,
// Gas Popover
currentTransaction: PropTypes.object.isRequired,
contact: PropTypes.object,
isOwnedAccount: PropTypes.bool,
supportsEIP1559V2: PropTypes.bool,
nativeCurrency: PropTypes.string,
isBuyableChain: PropTypes.bool,
@ -182,8 +176,6 @@ export default class ConfirmPageContainer extends Component {
editingGas,
handleCloseEditGas,
currentTransaction,
contact = {},
isOwnedAccount,
supportsEIP1559V2,
nativeCurrency,
isBuyableChain,
@ -195,9 +187,6 @@ export default class ConfirmPageContainer extends Component {
assetStandard,
} = this.props;
const showAddToAddressDialog =
!contact.name && toAddress && !isOwnedAccount && !hideSenderToRecipient;
const shouldDisplayWarning =
contentComponent && disabled && (errorKey || errorMessage);
@ -263,28 +252,7 @@ export default class ConfirmPageContainer extends Component {
)}
</ConfirmPageContainerHeader>
)}
<div>
{showAddToAddressDialog && (
<>
<Dialog
type="message"
className="send__dialog"
onClick={() => this.setState({ showNicknamePopovers: true })}
>
{t('newAccountDetectedDialogMessage')}
</Dialog>
{this.state.showNicknamePopovers ? (
<NicknamePopovers
onClose={() =>
this.setState({ showNicknamePopovers: false })
}
address={toAddress}
/>
) : null}
</>
)}
</div>
<EnableEIP1559V2Notice isFirstAlert={!showAddToAddressDialog} />
<EnableEIP1559V2Notice />
{contentComponent || (
<ConfirmPageContainerContent
action={action}
@ -316,7 +284,6 @@ export default class ConfirmPageContainer extends Component {
ethGasPriceWarning={ethGasPriceWarning}
hideTitle={hideTitle}
supportsEIP1559V2={supportsEIP1559V2}
hasTopBorder={showAddToAddressDialog}
currentTransaction={currentTransaction}
nativeCurrency={nativeCurrency}
networkName={networkName}

View File

@ -1,6 +1,5 @@
import { connect } from 'react-redux';
import {
getAccountsWithLabels,
getAddressBookEntry,
getIsBuyableChain,
getNetworkIdentifier,
@ -8,6 +7,7 @@ import {
getMetadataContractName,
getAccountName,
getMetaMaskIdentities,
getAccountsWithLabels,
} from '../../../selectors';
import ConfirmPageContainer from './confirm-page-container.component';

View File

@ -1,5 +1,4 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useHistory } from 'react-router-dom';
import { useSelector } from 'react-redux';
@ -20,7 +19,7 @@ import { setEnableEIP1559V2NoticeDismissed } from '../../../../store/actions';
import { getEnableEIP1559V2NoticeDismissed } from '../../../../ducks/metamask/metamask';
import { getEIP1559V2Enabled } from '../../../../selectors';
export default function EnableEIP1559V2Notice({ isFirstAlert }) {
export default function EnableEIP1559V2Notice() {
const t = useI18nContext();
const history = useHistory();
const enableEIP1559V2NoticeDismissed = useSelector(
@ -33,24 +32,20 @@ export default function EnableEIP1559V2Notice({ isFirstAlert }) {
}
return (
<Box
marginRight={4}
marginBottom={4}
marginLeft={4}
marginTop={isFirstAlert ? 4 : 0}
className="enableEIP1559V2-notice"
>
<Box margin={4} className="enableEIP1559V2-notice">
<Dialog type="message" className="enableEIP1559V2-notice__dialog">
<button
onClick={setEnableEIP1559V2NoticeDismissed}
className="enableEIP1559V2-notice__close-button"
data-testid="enableEIP1559V2-notice-close"
/>
>
<i className="fa fa-times enableEIP1559V2-notice__close-button__icon" />
</button>
<Box display={DISPLAY.FLEX}>
<Box paddingTop={2}>
<i style={{ fontSize: '1rem' }} className="fa fa-info-circle" />
<Box paddingTop={1}>
<i className="fa fa-info-circle" />
</Box>
<Box paddingLeft={4}>
<Box paddingLeft={2}>
<Typography
color={COLORS.TEXT_DEFAULT}
align={TEXT_ALIGN.LEFT}
@ -64,11 +59,12 @@ export default function EnableEIP1559V2Notice({ isFirstAlert }) {
align={TEXT_ALIGN.LEFT}
variant={TYPOGRAPHY.H7}
boxProps={{ marginBottom: 2 }}
tag="p"
>
{t('enableEIP1559V2AlertMessage')}
</Typography>
<Button
type="link"
type="inline"
onClick={() => {
history.push(EXPERIMENTAL_ROUTE);
}}
@ -82,7 +78,3 @@ export default function EnableEIP1559V2Notice({ isFirstAlert }) {
</Box>
);
}
EnableEIP1559V2Notice.propTypes = {
isFirstAlert: PropTypes.bool,
};

View File

@ -1,33 +1,16 @@
.enableEIP1559V2-notice {
&__dialog {
position: relative;
}
&__close-button {
background-color: transparent;
position: absolute;
right: 0;
top: 0;
&::after {
position: absolute;
content: '\00D7';
font-size: 29px;
font-weight: 200;
color: var(--color-text-default);
background-color: transparent;
top: 0;
right: 12px;
cursor: pointer;
}
}
a.enableEIP1559V2-notice__link {
@include H7;
top: 12px;
padding: 0;
justify-content: flex-start;
font-weight: bold;
font-size: 0.75rem;
&__icon {
color: var(--color-icon-default);
font-size: $font-size-paragraph;
}
}
}

View File

@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
import PageContainerContent from '../../../components/ui/page-container/page-container-content.component';
import Dialog from '../../../components/ui/dialog';
import ActionableMessage from '../../../components/ui/actionable-message';
import NicknamePopovers from '../../../components/app/modals/nickname-popovers';
import {
ETH_GAS_PRICE_FETCH_WARNING_KEY,
GAS_PRICE_FETCH_FAILURE_ERROR_KEY,
@ -19,18 +18,12 @@ import SendAssetRow from './send-asset-row';
import SendGasRow from './send-gas-row';
export default class SendContent extends Component {
state = {
showNicknamePopovers: false,
};
static contextTypes = {
t: PropTypes.func,
};
static propTypes = {
showHexData: PropTypes.bool,
contact: PropTypes.object,
isOwnedAccount: PropTypes.bool,
warning: PropTypes.string,
error: PropTypes.string,
gasIsExcessive: PropTypes.bool.isRequired,
@ -39,7 +32,6 @@ export default class SendContent extends Component {
networkOrAccountNotSupports1559: PropTypes.bool,
getIsBalanceInsufficient: PropTypes.bool,
asset: PropTypes.object,
to: PropTypes.string,
assetError: PropTypes.string,
recipient: PropTypes.object,
acknowledgeRecipientWarning: PropTypes.func,
@ -76,7 +68,6 @@ export default class SendContent extends Component {
const showKnownRecipientWarning =
recipient.warning === 'knownAddressRecipient';
const hideAddContactDialog = recipient.warning === 'loading';
return (
<PageContainerContent>
@ -90,9 +81,6 @@ export default class SendContent extends Component {
{showKnownRecipientWarning && !recipientWarningAcknowledged
? this.renderRecipientWarning()
: null}
{showKnownRecipientWarning || hideAddContactDialog
? null
: this.maybeRenderAddContact()}
<SendAssetRow />
<SendAmountRow />
{networkOrAccountNotSupports1559 ? <SendGasRow /> : null}
@ -103,35 +91,6 @@ export default class SendContent extends Component {
);
}
maybeRenderAddContact() {
const { t } = this.context;
const { isOwnedAccount, contact = {}, to } = this.props;
const { showNicknamePopovers } = this.state;
if (isOwnedAccount || contact.name) {
return null;
}
return (
<>
<Dialog
type="message"
className="send__dialog"
onClick={() => this.setState({ showNicknamePopovers: true })}
>
{t('newAccountDetectedDialogMessage')}
</Dialog>
{showNicknamePopovers ? (
<NicknamePopovers
onClose={() => this.setState({ showNicknamePopovers: false })}
address={to}
/>
) : null}
</>
);
}
renderWarning(gasWarning = '') {
const { t } = this.context;
const { warning } = this.props;

View File

@ -1,14 +1,11 @@
import { connect } from 'react-redux';
import {
accountsWithSendEtherInfoSelector,
getAddressBookEntry,
getIsEthGasPriceFetched,
getNoGasPriceFetched,
checkNetworkOrAccountNotSupports1559,
} from '../../../selectors';
import {
getIsBalanceInsufficient,
getSendTo,
getSendAsset,
getAssetError,
getRecipient,
@ -18,22 +15,13 @@ import {
import SendContent from './send-content.component';
function mapStateToProps(state) {
const ownedAccounts = accountsWithSendEtherInfoSelector(state);
const to = getSendTo(state);
const recipient = getRecipient(state);
const recipientWarningAcknowledged =
getRecipientWarningAcknowledgement(state);
return {
isOwnedAccount: Boolean(
ownedAccounts.find(
({ address }) => address.toLowerCase() === to.toLowerCase(),
),
),
contact: getAddressBookEntry(state, to),
isEthGasPrice: getIsEthGasPriceFetched(state),
noGasPrice: getNoGasPriceFetched(state),
to,
networkOrAccountNotSupports1559:
checkNetworkOrAccountNotSupports1559(state),
getIsBalanceInsufficient: getIsBalanceInsufficient(state),

View File

@ -80,5 +80,5 @@ DefaultStory.args = {
networkOrAccountNotSupports1559: false,
getIsBalanceInsufficient: false,
to: 'string to',
assetError: 'newAccountDetectedDialogMessage',
assetError: null,
};