mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
hide connected-status on metamask ext (#8703)
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
This commit is contained in:
parent
cf60c8e1f6
commit
c3b29e192a
@ -1,4 +1,7 @@
|
||||
import React, { useState } from 'react'
|
||||
import extension from 'extensionizer'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { useSelector } from 'react-redux'
|
||||
import SelectedAccount from '../selected-account'
|
||||
import ConnectedStatusIndicator from '../connected-status-indicator'
|
||||
import AccountOptionsMenu from './account-options-menu'
|
||||
@ -7,7 +10,7 @@ import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums'
|
||||
import { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes'
|
||||
import { useI18nContext } from '../../../hooks/useI18nContext'
|
||||
import { useMetricEvent } from '../../../hooks/useMetricEvent'
|
||||
import { useHistory } from 'react-router-dom'
|
||||
import { getOriginOfCurrentTab } from '../../../selectors'
|
||||
|
||||
export default function MenuBar () {
|
||||
const t = useI18nContext()
|
||||
@ -21,11 +24,14 @@ export default function MenuBar () {
|
||||
const history = useHistory()
|
||||
const [accountOptionsButtonElement, setAccountOptionsButtonElement] = useState(null)
|
||||
const [accountOptionsMenuOpen, setAccountOptionsMenuOpen] = useState(false)
|
||||
const origin = useSelector(getOriginOfCurrentTab)
|
||||
|
||||
const showStatus = getEnvironmentType() === ENVIRONMENT_TYPE_POPUP && origin !== extension.runtime.id
|
||||
|
||||
return (
|
||||
<div className="menu-bar">
|
||||
{
|
||||
getEnvironmentType() === ENVIRONMENT_TYPE_POPUP
|
||||
showStatus
|
||||
? <ConnectedStatusIndicator onClick={() => history.push(CONNECTED_ACCOUNTS_ROUTE)} />
|
||||
: null
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user