diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-26 10:46:42 +0800 |
---|---|---|
committer | Chi Kei Chan <chikeichan@gmail.com> | 2017-10-26 10:46:42 +0800 |
commit | db5326dfc288015a4d9f792653a71fd4d7abca33 (patch) | |
tree | cb93f52f999816d07a6146274093aaebdb7ed8d3 /ui/app/components/account-menu/index.js | |
parent | a9a841ba01f6bffa29a3e0491e3a88f6aff72ac7 (diff) | |
parent | b2e440e4ffba6db29cf8a928a41534c1f204d485 (diff) | |
download | tangerine-wallet-browser-db5326dfc288015a4d9f792653a71fd4d7abca33.tar tangerine-wallet-browser-db5326dfc288015a4d9f792653a71fd4d7abca33.tar.gz tangerine-wallet-browser-db5326dfc288015a4d9f792653a71fd4d7abca33.tar.bz2 tangerine-wallet-browser-db5326dfc288015a4d9f792653a71fd4d7abca33.tar.lz tangerine-wallet-browser-db5326dfc288015a4d9f792653a71fd4d7abca33.tar.xz tangerine-wallet-browser-db5326dfc288015a4d9f792653a71fd4d7abca33.tar.zst tangerine-wallet-browser-db5326dfc288015a4d9f792653a71fd4d7abca33.zip |
Merge branch 'NewUI-flat' into uat
Diffstat (limited to 'ui/app/components/account-menu/index.js')
-rw-r--r-- | ui/app/components/account-menu/index.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ui/app/components/account-menu/index.js b/ui/app/components/account-menu/index.js index 85bd21076..38c7bcb2d 100644 --- a/ui/app/components/account-menu/index.js +++ b/ui/app/components/account-menu/index.js @@ -46,6 +46,10 @@ function mapDispatchToProps (dispatch) { dispatch(actions.showImportPage()) dispatch(actions.toggleAccountMenu()) }, + showInfoPage: () => { + dispatch(actions.showInfoPage()) + dispatch(actions.toggleAccountMenu()) + }, } } @@ -57,16 +61,18 @@ AccountMenu.prototype.render = function () { showImportPage, lockMetamask, showConfigPage, + showInfoPage, } = this.props return h(Menu, { className: 'account-menu', isShowing: isAccountMenuOpen }, [ h(CloseArea, { onClick: toggleAccountMenu }), h(Item, { className: 'account-menu__header', - onClick: lockMetamask, }, [ 'My Accounts', - h('button.account-menu__logout-button', 'Log out'), + h('button.account-menu__logout-button', { + onClick: lockMetamask, + }, 'Log out'), ]), h(Divider), h('div.account-menu__accounts', this.renderAccounts()), @@ -83,6 +89,7 @@ AccountMenu.prototype.render = function () { }), h(Divider), h(Item, { + onClick: showInfoPage, icon: h('img', { src: 'images/mm-info-icon.svg' }), text: 'Info & Help', }), @@ -98,15 +105,14 @@ AccountMenu.prototype.renderAccounts = function () { const { identities, accounts, - selected, + selectedAddress, keyrings, showAccountDetail, } = this.props - console.log({ accounts }) return Object.keys(identities).map((key, index) => { const identity = identities[key] - const isSelected = identity.address === selected + const isSelected = identity.address === selectedAddress const balanceValue = accounts[key] ? accounts[key].balance : '' const formattedBalance = balanceValue ? formatBalance(balanceValue, 6) : '...' @@ -122,7 +128,7 @@ AccountMenu.prototype.renderAccounts = function () { { onClick: () => showAccountDetail(identity.address) }, [ h('div.account-menu__check-mark', [ - isSelected ? h('i.fa.fa-check') : null, + isSelected ? h('div.account-menu__check-mark-icon') : null, ]), h( @@ -148,6 +154,6 @@ AccountMenu.prototype.indicateIfLoose = function (keyring) { try { // Sometimes keyrings aren't loaded yet: const type = keyring.type const isLoose = type !== 'HD Key Tree' - return isLoose ? h('.keyring-label', 'LOOSE') : null + return isLoose ? h('.keyring-label', 'IMPORTED') : null } catch (e) { return } } |