aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/token-cell.js
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2017-06-14 08:47:56 +0800
committerDan Finlay <dan@danfinlay.com>2017-06-14 08:53:42 +0800
commit108c4ab2c58074aa8148828fbbef8cbf3a4e23f5 (patch)
treee09b0ee929a73cd5d545ac90f695b23568c9ef58 /ui/app/components/token-cell.js
parentde500250c463f51f68abff44c8ed6c20912b48c0 (diff)
downloadtangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar
tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar.gz
tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar.bz2
tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar.lz
tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar.xz
tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.tar.zst
tangerine-wallet-browser-108c4ab2c58074aa8148828fbbef8cbf3a4e23f5.zip
Auto populate token list with popular token balances
Half implements #175 Things to do: - Add ability to add tokens to the list. - Persist the token tab selection (so it is an implicit preference) - Check what's up with the token-tracker polling, it seems like it is not waiting the interval.
Diffstat (limited to 'ui/app/components/token-cell.js')
-rw-r--r--ui/app/components/token-cell.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/ui/app/components/token-cell.js b/ui/app/components/token-cell.js
index 879dc01d1..ad7f55345 100644
--- a/ui/app/components/token-cell.js
+++ b/ui/app/components/token-cell.js
@@ -12,11 +12,19 @@ function TokenCell () {
TokenCell.prototype.render = function () {
const props = this.props
- const { address, symbol, string, network } = props
- log.info({ address, symbol, string })
+ const { address, symbol, string, network, userAddress } = props
+ log.info({ address, symbol, string, network })
return (
- h('li.token-cell', [
+ h('li.token-cell', {
+ style: { cursor: network === '1' ? 'pointer' : 'default' },
+ onClick: (event) => {
+ const url = urlFor(address, userAddress, network)
+ if (url) {
+ navigateTo(url)
+ }
+ },
+ }, [
h(Identicon, {
diameter: 50,
@@ -29,3 +37,11 @@ TokenCell.prototype.render = function () {
)
}
+function navigateTo (url) {
+ global.platform.openWindow({ url })
+}
+
+function urlFor (tokenAddress, address, network) {
+ return `https://etherscan.io/token/${tokenAddress}?a=${address}`
+}
+