Don't render the ConnectedStatusIndicator outside of the popup (#8275)

feature/default_network_editable
Whymarrh Whitby 5 years ago committed by GitHub
parent d1cd2bb618
commit 8459e8dda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      ui/app/components/app/connected-status-indicator/connected-status-indicator.component.js
  2. 8
      ui/app/components/app/menu-bar/menu-bar.component.js

@ -1,8 +1,6 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import PropTypes from 'prop-types' import PropTypes from 'prop-types'
import classnames from 'classnames' import classnames from 'classnames'
import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums'
import { getEnvironmentType } from '../../../../../app/scripts/lib/util'
import { import {
STATUS_CONNECTED, STATUS_CONNECTED,
STATUS_CONNECTED_TO_ANOTHER_ACCOUNT, STATUS_CONNECTED_TO_ANOTHER_ACCOUNT,
@ -50,10 +48,7 @@ export default class ConnectedStatusIndicator extends Component {
render () { render () {
return ( return (
<div className={classnames('connected-status-indicator', { <div className="connected-status-indicator">
invisible: getEnvironmentType() !== ENVIRONMENT_TYPE_POPUP,
})}
>
{ this.renderStatusCircle() } { this.renderStatusCircle() }
{ this.renderStatusText() } { this.renderStatusText() }
</div> </div>

@ -4,6 +4,8 @@ import Tooltip from '../../ui/tooltip'
import SelectedAccount from '../selected-account' import SelectedAccount from '../selected-account'
import ConnectedStatusIndicator from '../connected-status-indicator' import ConnectedStatusIndicator from '../connected-status-indicator'
import AccountDetailsDropdown from '../dropdowns/account-details-dropdown' import AccountDetailsDropdown from '../dropdowns/account-details-dropdown'
import { getEnvironmentType } from '../../../../../app/scripts/lib/util'
import { ENVIRONMENT_TYPE_POPUP } from '../../../../../app/scripts/lib/enums'
export default class MenuBar extends PureComponent { export default class MenuBar extends PureComponent {
static contextTypes = { static contextTypes = {
@ -19,7 +21,11 @@ export default class MenuBar extends PureComponent {
return ( return (
<div className="menu-bar"> <div className="menu-bar">
<ConnectedStatusIndicator /> {
getEnvironmentType() === ENVIRONMENT_TYPE_POPUP
? <ConnectedStatusIndicator />
: null
}
<SelectedAccount /> <SelectedAccount />

Loading…
Cancel
Save