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 () {
await driver.clickElement(By.css('[data-testid="account-options-menu-button"]'))
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
// account menu button chosen because the menu never covers it.
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 { useI18nContext } from '../../../hooks/useI18nContext'
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 }) {
const t = useI18nContext()
@ -58,16 +60,22 @@ export default function AccountOptionsMenu ({ anchorElement, onClose }) {
className="account-options-menu"
onHide={onClose}
>
<MenuItem
onClick={() => {
openFullscreenEvent()
global.platform.openExtensionInBrowser()
onClose()
}}
iconClassName="fas fa-expand-alt"
>
{ t('expandView') }
</MenuItem>
{
getEnvironmentType() === ENVIRONMENT_TYPE_FULLSCREEN
? null
: (
<MenuItem
onClick={() => {
openFullscreenEvent()
global.platform.openExtensionInBrowser()
onClose()
}}
iconClassName="fas fa-expand-alt"
>
{ t('expandView') }
</MenuItem>
)
}
<MenuItem
data-testid="account-options-menu__account-details"
onClick={() => {