diff options
author | Alexander Tseung <alextsg@gmail.com> | 2018-07-31 01:42:09 +0800 |
---|---|---|
committer | Alexander Tseung <alextsg@gmail.com> | 2018-08-24 07:44:43 +0800 |
commit | 8a7547b9cd2d9e636883af55fd6382ebcbabf4f1 (patch) | |
tree | 19912a0eaf7c62e0fb33c8a3960c48008e3df587 /ui/app/components/menu-bar/menu-bar.component.js | |
parent | d1de5ae94f1662f35a7b031ac59b4bb9bd719695 (diff) | |
download | tangerine-wallet-browser-8a7547b9cd2d9e636883af55fd6382ebcbabf4f1.tar tangerine-wallet-browser-8a7547b9cd2d9e636883af55fd6382ebcbabf4f1.tar.gz tangerine-wallet-browser-8a7547b9cd2d9e636883af55fd6382ebcbabf4f1.tar.bz2 tangerine-wallet-browser-8a7547b9cd2d9e636883af55fd6382ebcbabf4f1.tar.lz tangerine-wallet-browser-8a7547b9cd2d9e636883af55fd6382ebcbabf4f1.tar.xz tangerine-wallet-browser-8a7547b9cd2d9e636883af55fd6382ebcbabf4f1.tar.zst tangerine-wallet-browser-8a7547b9cd2d9e636883af55fd6382ebcbabf4f1.zip |
Add MenuBar component
Diffstat (limited to 'ui/app/components/menu-bar/menu-bar.component.js')
-rw-r--r-- | ui/app/components/menu-bar/menu-bar.component.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/ui/app/components/menu-bar/menu-bar.component.js b/ui/app/components/menu-bar/menu-bar.component.js new file mode 100644 index 000000000..eee9feebb --- /dev/null +++ b/ui/app/components/menu-bar/menu-bar.component.js @@ -0,0 +1,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> + ) + } +} |