aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/token-cell.js
diff options
context:
space:
mode:
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}`
+}
+