From 26370da13d7bed06d59efeba0a4921387b874e06 Mon Sep 17 00:00:00 2001
From: Brandon Millman <brandon.millman@gmail.com>
Date: Mon, 21 May 2018 16:35:49 -0700
Subject: Rewrite balance rows using flex box

---
 packages/website/ts/components/ui/token_icon.tsx | 25 +++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

(limited to 'packages/website/ts/components/ui/token_icon.tsx')

diff --git a/packages/website/ts/components/ui/token_icon.tsx b/packages/website/ts/components/ui/token_icon.tsx
index a9ad567ef..0875cc56b 100644
--- a/packages/website/ts/components/ui/token_icon.tsx
+++ b/packages/website/ts/components/ui/token_icon.tsx
@@ -6,6 +6,7 @@ import { Token } from 'ts/types';
 interface TokenIconProps {
     token: Token;
     diameter: number;
+    link?: string;
 }
 
 interface TokenIconState {}
@@ -14,14 +15,20 @@ export class TokenIcon extends React.Component<TokenIconProps, TokenIconState> {
     public render(): React.ReactNode {
         const token = this.props.token;
         const diameter = this.props.diameter;
-        return (
-            <div>
-                {token.isRegistered && !_.isUndefined(token.iconUrl) ? (
-                    <img style={{ width: diameter, height: diameter }} src={token.iconUrl} />
-                ) : (
-                    <Identicon address={token.address} diameter={diameter} />
-                )}
-            </div>
-        );
+        const icon =
+            token.isRegistered && !_.isUndefined(token.iconUrl) ? (
+                <img style={{ width: diameter, height: diameter }} src={token.iconUrl} />
+            ) : (
+                <Identicon address={token.address} diameter={diameter} />
+            );
+        if (_.isEmpty(this.props.link)) {
+            return icon;
+        } else {
+            return (
+                <a href={this.props.link} target="_blank" style={{ textDecoration: 'none' }}>
+                    {icon}
+                </a>
+            );
+        }
     }
 }
-- 
cgit v1.2.3

