1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

Merge pull request #4779 from whymarrh/tx-view-tooltips

Add Tooltips to Balance View in Extension
This commit is contained in:
Whymarrh Whitby 2018-07-12 15:43:53 -02:30 committed by GitHub
commit 55232d80d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 13 deletions

View File

@ -515,6 +515,9 @@
"mainnet": { "mainnet": {
"message": "Main Ethereum Network" "message": "Main Ethereum Network"
}, },
"menu": {
"message": "Menu"
},
"message": { "message": {
"message": "Message" "message": "Message"
}, },
@ -596,6 +599,9 @@
"oldUIMessage": { "oldUIMessage": {
"message": "You have returned to the old UI. You can switch back to the New UI through the option in the top right dropdown menu." "message": "You have returned to the old UI. You can switch back to the New UI through the option in the top right dropdown menu."
}, },
"openInTab": {
"message": "Open in tab"
},
"or": { "or": {
"message": "or", "message": "or",
"description": "choice between creating or importing a new account" "description": "choice between creating or importing a new account"

View File

@ -11,6 +11,7 @@ const { SEND_ROUTE } = require('../routes')
const { checksumAddress: toChecksumAddress } = require('../util') const { checksumAddress: toChecksumAddress } = require('../util')
const BalanceComponent = require('./balance-component') const BalanceComponent = require('./balance-component')
const Tooltip = require('./tooltip')
const TxList = require('./tx-list') const TxList = require('./tx-list')
const SelectedAccount = require('./selected-account') const SelectedAccount = require('./selected-account')
@ -103,7 +104,8 @@ TxView.prototype.renderButtons = function () {
} }
TxView.prototype.render = function () { TxView.prototype.render = function () {
const { isMascara } = this.props const { hideSidebar, isMascara, showSidebar, sidebarOpen } = this.props
const { t } = this.context
return h('div.tx-view.flex-column', { return h('div.tx-view.flex-column', {
style: {}, style: {},
@ -120,21 +122,30 @@ TxView.prototype.render = function () {
}, },
}, [ }, [
h('div.fa.fa-bars', { h(Tooltip, {
style: { title: t('menu'),
fontSize: '1.3em', position: 'bottom',
cursor: 'pointer', }, [
padding: '10px', h('div.fa.fa-bars', {
}, style: {
onClick: () => this.props.sidebarOpen ? this.props.hideSidebar() : this.props.showSidebar(), fontSize: '1.3em',
}), cursor: 'pointer',
padding: '10px',
},
onClick: () => sidebarOpen ? hideSidebar() : showSidebar(),
}),
]),
h(SelectedAccount), h(SelectedAccount),
!isMascara && h('div.open-in-browser', { !isMascara && h(Tooltip, {
onClick: () => global.platform.openExtensionInBrowser(), title: t('openInTab'),
}, [h('img', { src: 'images/popout.svg' })]), position: 'bottom',
}, [
h('div.open-in-browser', {
onClick: () => global.platform.openExtensionInBrowser(),
}, [h('img', { src: 'images/popout.svg' })]),
]),
]), ]),
this.renderHeroBalance(), this.renderHeroBalance(),