diff options
author | Frankie <frankie.pangilinan@consensys.net> | 2016-08-11 04:48:34 +0800 |
---|---|---|
committer | Frankie <frankie.pangilinan@consensys.net> | 2016-08-11 04:48:34 +0800 |
commit | ba1edc429b948962fe0f03ef43588f7945cea3f2 (patch) | |
tree | eda1b54a424c2fc06ef151763b5cb57d2e838116 /ui/app/components | |
parent | 9c6dd9ef4953f6e421feb6e6684ef43da26f6b75 (diff) | |
parent | c48b60d7a6f14d2d2348be8d9a63965ca1267433 (diff) | |
download | tangerine-wallet-browser-ba1edc429b948962fe0f03ef43588f7945cea3f2.tar tangerine-wallet-browser-ba1edc429b948962fe0f03ef43588f7945cea3f2.tar.gz tangerine-wallet-browser-ba1edc429b948962fe0f03ef43588f7945cea3f2.tar.bz2 tangerine-wallet-browser-ba1edc429b948962fe0f03ef43588f7945cea3f2.tar.lz tangerine-wallet-browser-ba1edc429b948962fe0f03ef43588f7945cea3f2.tar.xz tangerine-wallet-browser-ba1edc429b948962fe0f03ef43588f7945cea3f2.tar.zst tangerine-wallet-browser-ba1edc429b948962fe0f03ef43588f7945cea3f2.zip |
Merge branch 'master' into buyForm
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/drop-menu-item.js | 15 | ||||
-rw-r--r-- | ui/app/components/network.js | 26 | ||||
-rw-r--r-- | ui/app/components/pending-tx-details.js | 3 | ||||
-rw-r--r-- | ui/app/components/transaction-list-item.js | 3 |
4 files changed, 37 insertions, 10 deletions
diff --git a/ui/app/components/drop-menu-item.js b/ui/app/components/drop-menu-item.js index f5800f799..1a0d6cbd5 100644 --- a/ui/app/components/drop-menu-item.js +++ b/ui/app/components/drop-menu-item.js @@ -32,20 +32,25 @@ DropMenuItem.prototype.render = function () { } DropMenuItem.prototype.activeNetworkRender = function () { - var activeNetwork = this.props.activeNetworkRender + let activeNetwork = this.props.activeNetworkRender + let { provider } = this.props + let providerType = provider ? provider.type : null if (activeNetwork === undefined) return switch (this.props.label) { case 'Main Ethereum Network': - if (activeNetwork === '1') return h('.check', ' ✓') + if (providerType === 'mainnet') return h('.check', '✓') + break + case 'Ethereum Classic Network': + if (providerType === 'classic') return h('.check', '✓') break case 'Morden Test Network': - if (activeNetwork === '2') return h('.check', ' ✓') + if (activeNetwork === '2') return h('.check', '✓') break case 'Localhost 8545': - if (activeNetwork === 'http://localhost:8545') return h('.check', ' ✓') + if (activeNetwork === 'http://localhost:8545') return h('.check', '✓') break default: - if (activeNetwork === 'custom') return h('.check', ' ✓') + if (activeNetwork === 'custom') return h('.check', '✓') } } diff --git a/ui/app/components/network.js b/ui/app/components/network.js index 032e71699..95901fe70 100644 --- a/ui/app/components/network.js +++ b/ui/app/components/network.js @@ -11,11 +11,18 @@ function Network () { } Network.prototype.render = function () { - const state = this.props - const networkNumber = state.network + const props = this.props + const networkNumber = props.network + let providerName + try { + providerName = props.provider.type + } catch (e) { + providerName = null + } let iconName, hoverText if (networkNumber === 'loading') { + return h('img', { title: 'Attempting to connect to blockchain.', onClick: (event) => this.props.onClick(event), @@ -25,9 +32,13 @@ Network.prototype.render = function () { }, src: 'images/loading.svg', }) - } else if (parseInt(networkNumber) === 1) { + + } else if (providerName === 'mainnet') { hoverText = 'Main Ethereum Network' iconName = 'ethereum-network' + } else if (providerName === 'classic') { + hoverText = 'Ethereum Classic Network' + iconName = 'classic-network' } else if (parseInt(networkNumber) === 2) { hoverText = 'Morden Test Network' iconName = 'morden-test-network' @@ -55,6 +66,15 @@ Network.prototype.render = function () { }}, 'Etherum Main Net'), ]) + case 'classic-network': + return h('.network-indicator', [ + h('.menu-icon.hollow-diamond'), + h('.network-name', { + style: { + color: '#039396', + }}, + 'Etherum Classic'), + ]) case 'morden-test-network': return h('.network-indicator', [ h('.menu-icon.red-dot'), diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index a6f72a89b..2fb0eae3f 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -28,7 +28,8 @@ PTXP.render = function () { var txParams = txData.txParams || {} var address = txParams.from || props.selectedAddress var identity = props.identities[address] || { address: address } - var balance = props.accounts[address].balance + var account = props.accounts[address] + var balance = account ? account.balance : '0x0' var gasCost = new BN(ethUtil.stripHexPrefix(txParams.gas || txData.estimatedGas), 16) var gasPrice = new BN(ethUtil.stripHexPrefix(txParams.gasPrice || '0x4a817c800'), 16) diff --git a/ui/app/components/transaction-list-item.js b/ui/app/components/transaction-list-item.js index 78867fca4..796ba61ae 100644 --- a/ui/app/components/transaction-list-item.js +++ b/ui/app/components/transaction-list-item.js @@ -7,6 +7,7 @@ const addressSummary = require('../util').addressSummary const explorerLink = require('../../lib/explorer-link') const CopyButton = require('./copyButton') const vreme = new (require('vreme')) +const extension = require('../../../app/scripts/lib/extension') const TransactionIcon = require('./transaction-list-item-icon') @@ -49,7 +50,7 @@ TransactionListItem.prototype.render = function () { if (!transaction.hash || !isLinkable) return var url = explorerLink(transaction.hash, parseInt(network)) - chrome.tabs.create({ url }) + extension.tabs.create({ url }) }, style: { padding: '20px 0', |