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

Hide 'Expand view' button in fullscreen (#8826)

The 'Expand view' button in the 'Account Options' menu was still being
shown on the fullscreen UI. This button is not useful in fullscreen, as
all it does is open the fullscreen UI. It is now hidden on the
fullscreen UI.
This commit is contained in:
Mark Stacey 2020-06-17 00:40:56 -03:00 committed by GitHub
parent 792366a20f
commit dafc5046ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 11 deletions

View File

@ -119,7 +119,7 @@ describe('MetaMask', function () {
it('show account details dropdown menu', async function () { it('show account details dropdown menu', async function () {
await driver.clickElement(By.css('[data-testid="account-options-menu-button"]')) await driver.clickElement(By.css('[data-testid="account-options-menu-button"]'))
const options = await driver.findElements(By.css('.account-options-menu .menu-item')) const options = await driver.findElements(By.css('.account-options-menu .menu-item'))
assert.equal(options.length, 4) // HD Wallet type does not have to show the Remove Account option assert.equal(options.length, 3) // HD Wallet type does not have to show the Remove Account option
// click outside of menu to dismiss // click outside of menu to dismiss
// account menu button chosen because the menu never covers it. // account menu button chosen because the menu never covers it.
await driver.clickPoint(By.css('.account-menu__icon'), 0, 0) await driver.clickPoint(By.css('.account-menu__icon'), 0, 0)

View File

@ -10,6 +10,8 @@ import genAccountLink from '../../../../lib/account-link'
import { getCurrentKeyring, getCurrentNetwork, getRpcPrefsForCurrentProvider, getSelectedIdentity } from '../../../selectors' import { getCurrentKeyring, getCurrentNetwork, getRpcPrefsForCurrentProvider, getSelectedIdentity } from '../../../selectors'
import { useI18nContext } from '../../../hooks/useI18nContext' import { useI18nContext } from '../../../hooks/useI18nContext'
import { useMetricEvent } from '../../../hooks/useMetricEvent' import { useMetricEvent } from '../../../hooks/useMetricEvent'
import { getEnvironmentType } from '../../../../../app/scripts/lib/util'
import { ENVIRONMENT_TYPE_FULLSCREEN } from '../../../../../app/scripts/lib/enums'
export default function AccountOptionsMenu ({ anchorElement, onClose }) { export default function AccountOptionsMenu ({ anchorElement, onClose }) {
const t = useI18nContext() const t = useI18nContext()
@ -58,16 +60,22 @@ export default function AccountOptionsMenu ({ anchorElement, onClose }) {
className="account-options-menu" className="account-options-menu"
onHide={onClose} onHide={onClose}
> >
<MenuItem {
onClick={() => { getEnvironmentType() === ENVIRONMENT_TYPE_FULLSCREEN
openFullscreenEvent() ? null
global.platform.openExtensionInBrowser() : (
onClose() <MenuItem
}} onClick={() => {
iconClassName="fas fa-expand-alt" openFullscreenEvent()
> global.platform.openExtensionInBrowser()
{ t('expandView') } onClose()
</MenuItem> }}
iconClassName="fas fa-expand-alt"
>
{ t('expandView') }
</MenuItem>
)
}
<MenuItem <MenuItem
data-testid="account-options-menu__account-details" data-testid="account-options-menu__account-details"
onClick={() => { onClick={() => {