hide connected-status on metamask ext (#8703)

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
feature/default_network_editable
Brad Decker 4 years ago committed by GitHub
parent cf60c8e1f6
commit c3b29e192a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      ui/app/components/app/menu-bar/menu-bar.js

@ -1,4 +1,7 @@
import React, { useState } from 'react' 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 SelectedAccount from '../selected-account'
import ConnectedStatusIndicator from '../connected-status-indicator' import ConnectedStatusIndicator from '../connected-status-indicator'
import AccountOptionsMenu from './account-options-menu' 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 { CONNECTED_ACCOUNTS_ROUTE } from '../../../helpers/constants/routes'
import { useI18nContext } from '../../../hooks/useI18nContext' import { useI18nContext } from '../../../hooks/useI18nContext'
import { useMetricEvent } from '../../../hooks/useMetricEvent' import { useMetricEvent } from '../../../hooks/useMetricEvent'
import { useHistory } from 'react-router-dom' import { getOriginOfCurrentTab } from '../../../selectors'
export default function MenuBar () { export default function MenuBar () {
const t = useI18nContext() const t = useI18nContext()
@ -21,11 +24,14 @@ export default function MenuBar () {
const history = useHistory() const history = useHistory()
const [accountOptionsButtonElement, setAccountOptionsButtonElement] = useState(null) const [accountOptionsButtonElement, setAccountOptionsButtonElement] = useState(null)
const [accountOptionsMenuOpen, setAccountOptionsMenuOpen] = useState(false) const [accountOptionsMenuOpen, setAccountOptionsMenuOpen] = useState(false)
const origin = useSelector(getOriginOfCurrentTab)
const showStatus = getEnvironmentType() === ENVIRONMENT_TYPE_POPUP && origin !== extension.runtime.id
return ( return (
<div className="menu-bar"> <div className="menu-bar">
{ {
getEnvironmentType() === ENVIRONMENT_TYPE_POPUP showStatus
? <ConnectedStatusIndicator onClick={() => history.push(CONNECTED_ACCOUNTS_ROUTE)} /> ? <ConnectedStatusIndicator onClick={() => history.push(CONNECTED_ACCOUNTS_ROUTE)} />
: null : null
} }

Loading…
Cancel
Save