diff options
author | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-04 08:17:00 +0800 |
---|---|---|
committer | sdtsui <szehungdanieltsui@gmail.com> | 2017-08-04 08:17:00 +0800 |
commit | 850e9b63d297c9da2403bb3796445df3cd500600 (patch) | |
tree | 50ab8c052168c3642976387ccdf59f30838b2b3f /ui | |
parent | ecb09fcc0aa801f553cd83659c06c429b5cfbf33 (diff) | |
download | tangerine-wallet-browser-850e9b63d297c9da2403bb3796445df3cd500600.tar tangerine-wallet-browser-850e9b63d297c9da2403bb3796445df3cd500600.tar.gz tangerine-wallet-browser-850e9b63d297c9da2403bb3796445df3cd500600.tar.bz2 tangerine-wallet-browser-850e9b63d297c9da2403bb3796445df3cd500600.tar.lz tangerine-wallet-browser-850e9b63d297c9da2403bb3796445df3cd500600.tar.xz tangerine-wallet-browser-850e9b63d297c9da2403bb3796445df3cd500600.tar.zst tangerine-wallet-browser-850e9b63d297c9da2403bb3796445df3cd500600.zip |
Move accountselector menu-droppo up to app-header
Diffstat (limited to 'ui')
-rw-r--r-- | ui/app/app.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ui/app/app.js b/ui/app/app.js index e23caa72b..bafc13d32 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -30,6 +30,8 @@ const QrView = require('./components/qr-code') const HDCreateVaultComplete = require('./keychains/hd/create-vault-complete') const HDRestoreVaultScreen = require('./keychains/hd/restore-vault') const RevealSeedConfirmation = require('./keychains/hd/recover-seed/confirmation') +const AccountDropdowns = require('./components/account-dropdowns').AccountDropdowns +const ethUtil = require('ethereumjs-util') module.exports = connect(mapStateToProps)(App) @@ -37,6 +39,14 @@ inherits(App, Component) function App () { Component.call(this) } function mapStateToProps (state) { + const { + identities, + accounts, + address, + } = state.metamask + let selected = address || Object.keys(accounts)[0] + // let checksumAddress = selected && ethUtil.toChecksumAddress(selected) + return { // state from plugin isLoading: state.appState.isLoading, @@ -57,6 +67,10 @@ function mapStateToProps (state) { lastUnreadNotice: state.metamask.lastUnreadNotice, lostAccounts: state.metamask.lostAccounts, frequentRpcList: state.metamask.frequentRpcList || [], + + // state needed to get account dropdown temporarily rendering from app bar + identities, + selected, } } @@ -169,6 +183,14 @@ App.prototype.renderAppBar = function () { }, }, [ + props.isUnlocked && h(AccountDropdowns, { + style: {}, + enableAccountsSelector: true, + identities: this.props.identities, + selected: this.props.selected, + network: this.props.network, + }, []), + // hamburger props.isUnlocked && h(SandwichExpando, { width: 16, |