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

Fix #19609 - Prevent rounded corners in account menu (#19615)

This commit is contained in:
David Walsh 2023-06-20 08:38:24 -05:00 committed by GitHub
parent 39089e0f4c
commit ba3f86400c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 10 deletions

View File

@ -42,7 +42,7 @@ describe('Add account', function () {
await driver.clickElement('[data-testid="account-menu-icon"]'); await driver.clickElement('[data-testid="account-menu-icon"]');
await driver.clickElement( await driver.clickElement(
'[data-testid="multichain-account-menu-add-account"]', '[data-testid="multichain-account-menu-popover-add-account"]',
); );
await driver.fill('[placeholder="Account 2"]', '2nd account'); await driver.fill('[placeholder="Account 2"]', '2nd account');
@ -84,7 +84,7 @@ describe('Add account', function () {
// Create 2nd account // Create 2nd account
await driver.clickElement('[data-testid="account-menu-icon"]'); await driver.clickElement('[data-testid="account-menu-icon"]');
await driver.clickElement( await driver.clickElement(
'[data-testid="multichain-account-menu-add-account"]', '[data-testid="multichain-account-menu-popover-add-account"]',
); );
await driver.fill('[placeholder="Account 2"]', '2nd account'); await driver.fill('[placeholder="Account 2"]', '2nd account');
await driver.clickElement({ text: 'Create', tag: 'button' }); await driver.clickElement({ text: 'Create', tag: 'button' });
@ -188,7 +188,7 @@ describe('Add account', function () {
await driver.clickElement('[data-testid="account-menu-icon"]'); await driver.clickElement('[data-testid="account-menu-icon"]');
await driver.clickElement( await driver.clickElement(
'[data-testid="multichain-account-menu-add-account"]', '[data-testid="multichain-account-menu-popover-add-account"]',
); );
await driver.fill('[placeholder="Account 2"]', '2nd account'); await driver.fill('[placeholder="Account 2"]', '2nd account');
await driver.clickElement({ text: 'Create', tag: 'button' }); await driver.clickElement({ text: 'Create', tag: 'button' });

View File

@ -36,7 +36,7 @@ async function loadNewAccount() {
await driver.clickElement('[data-testid="account-menu-icon"]'); await driver.clickElement('[data-testid="account-menu-icon"]');
const timestampBeforeAction = new Date(); const timestampBeforeAction = new Date();
await driver.clickElement( await driver.clickElement(
'[data-testid="multichain-account-menu-add-account"]', '[data-testid="multichain-account-menu-popover-add-account"]',
); );
await driver.fill('[placeholder="Account 2"]', '2nd account'); await driver.fill('[placeholder="Account 2"]', '2nd account');
await driver.clickElement({ text: 'Create', tag: 'button' }); await driver.clickElement({ text: 'Create', tag: 'button' });

View File

@ -101,6 +101,7 @@ export const AccountListMenu = ({ onClose }) => {
centerTitle centerTitle
onClose={onClose} onClose={onClose}
onBack={actionMode === '' ? null : () => setActionMode('')} onBack={actionMode === '' ? null : () => setActionMode('')}
className="multichain-account-menu-popover"
> >
{actionMode === 'add' ? ( {actionMode === 'add' ? (
<Box paddingLeft={4} paddingRight={4} paddingBottom={4} paddingTop={0}> <Box paddingLeft={4} paddingRight={4} paddingBottom={4} paddingTop={0}>
@ -129,7 +130,7 @@ export const AccountListMenu = ({ onClose }) => {
</Box> </Box>
) : null} ) : null}
{actionMode === '' ? ( {actionMode === '' ? (
<Box className="multichain-account-menu"> <Box>
{/* Search box */} {/* Search box */}
{accounts.length > 1 ? ( {accounts.length > 1 ? (
<Box <Box
@ -152,13 +153,13 @@ export const AccountListMenu = ({ onClose }) => {
</Box> </Box>
) : null} ) : null}
{/* Account list block */} {/* Account list block */}
<Box className="multichain-account-menu__list"> <Box className="multichain-account-menu-popover__list">
{searchResults.length === 0 && searchQuery !== '' ? ( {searchResults.length === 0 && searchQuery !== '' ? (
<Text <Text
paddingLeft={4} paddingLeft={4}
paddingRight={4} paddingRight={4}
color={TextColor.textMuted} color={TextColor.textMuted}
data-testid="multichain-account-menu-no-results" data-testid="multichain-account-menu-popover-no-results"
> >
{t('noAccountsFound')} {t('noAccountsFound')}
</Text> </Text>
@ -208,7 +209,7 @@ export const AccountListMenu = ({ onClose }) => {
}); });
setActionMode('add'); setActionMode('add');
}} }}
data-testid="multichain-account-menu-add-account" data-testid="multichain-account-menu-popover-add-account"
> >
{t('addAccount')} {t('addAccount')}
</ButtonLink> </ButtonLink>

View File

@ -101,7 +101,7 @@ describe('AccountListMenu', () => {
); );
expect(filteredListItems).toHaveLength(0); expect(filteredListItems).toHaveLength(0);
expect( expect(
getByTestId('multichain-account-menu-no-results'), getByTestId('multichain-account-menu-popover-no-results'),
).toBeInTheDocument(); ).toBeInTheDocument();
}); });

View File

@ -1,4 +1,8 @@
.multichain-account-menu { .multichain-account-menu-popover {
.popover-content {
border-radius: 0;
}
&__list { &__list {
max-height: 200px; max-height: 200px;
overflow: auto; overflow: auto;