aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/menu-bar/menu-bar.component.js
blob: eee9feebbf2fd4b39edc6581f6d75a823120d5a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Tooltip from '../tooltip'
import SelectedAccount from '../selected-account'

export default class MenuBar extends PureComponent {
  static contextTypes = {
    t: PropTypes.func,
  }

  static propTypes = {
    hideSidebar: PropTypes.func,
    isMascara: PropTypes.bool,
    sidebarOpen: PropTypes.bool,
    showSidebar: PropTypes.func,
  }

  render () {
    const { t } = this.context
    const { isMascara, sidebarOpen, hideSidebar, showSidebar } = this.props

    return (
      <div className="menu-bar">
        <Tooltip
          title={t('menu')}
          position="bottom"
        >
          <div
            className="fa fa-bars menu-bar__sidebar-button"
            onClick={() => sidebarOpen ? hideSidebar() : showSidebar()}
          />
        </Tooltip>
        <SelectedAccount />
        {
          !isMascara && (
            <Tooltip
              title={t('openInTab')}
              position="bottom"
            >
              <div
                className="menu-bar__open-in-browser"
                onClick={() => global.platform.openExtensionInBrowser()}
              >
                <img src="images/popout.svg" />
              </div>
            </Tooltip>
          )
        }
      </div>
    )
  }
}