diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-06-29 08:57:53 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-06-29 08:57:53 +0800 |
commit | 56cbd7d9eab76eeb55638766e16ea4c0ceb96962 (patch) | |
tree | d4d9c92d4c1ce80c88675e499098038cf85d5d14 | |
parent | 6238af633056c6136e37106bf5517ef87e3ff8f1 (diff) | |
download | tangerine-wallet-browser-56cbd7d9eab76eeb55638766e16ea4c0ceb96962.tar tangerine-wallet-browser-56cbd7d9eab76eeb55638766e16ea4c0ceb96962.tar.gz tangerine-wallet-browser-56cbd7d9eab76eeb55638766e16ea4c0ceb96962.tar.bz2 tangerine-wallet-browser-56cbd7d9eab76eeb55638766e16ea4c0ceb96962.tar.lz tangerine-wallet-browser-56cbd7d9eab76eeb55638766e16ea4c0ceb96962.tar.xz tangerine-wallet-browser-56cbd7d9eab76eeb55638766e16ea4c0ceb96962.tar.zst tangerine-wallet-browser-56cbd7d9eab76eeb55638766e16ea4c0ceb96962.zip |
Add custom to drop down menu
-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 80521d220..13770412d 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -46,6 +46,7 @@ function mapStateToProps (state) { unconfMsgs: state.metamask.unconfMsgs, menuOpen: state.appState.menuOpen, network: state.metamask.network, + provider: state.metamask.provider } } @@ -228,6 +229,7 @@ App.prototype.renderNetworkDropdown = function () { action: () => props.dispatch(actions.setRpcTarget('http://localhost:8545')), icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }), }), + this.renderCustomOption(props.provider.rpcTarget) ]) } @@ -355,3 +357,23 @@ App.prototype.toggleMetamaskActive = function () { this.props.dispatch(actions.lockMetamask(false)) } } + +App.prototype.renderCustomOption = function (rpcTarget) { + switch(rpcTarget){ + case undefined: + return h(DropMenuItem, { + label: 'Custom RPC', + closeMenu: () => this.setState({ isNetworkMenuOpen: false }), + action: () => this.props.dispatch(actions.showConfigPage()), + icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }), + }) + + default: + return h(DropMenuItem, { + label: `${rpcTarget}`, + closeMenu: () => this.setState({ isNetworkMenuOpen: false }), + action: () => this.props.dispatch(actions.showConfigPage()), + icon: h('i.fa.fa-question-circle.fa-lg', { ariaHidden: true }), + }) + } +} |