From 9e914be975e20771e0f442eb4b4b025d44eb1994 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Sun, 17 Dec 2017 14:14:23 -0600 Subject: Link all EtherTokens to Etherscan and add address tooltip --- packages/website/ts/components/eth_wrappers.tsx | 73 ++++++++++++++++++------- 1 file changed, 53 insertions(+), 20 deletions(-) diff --git a/packages/website/ts/components/eth_wrappers.tsx b/packages/website/ts/components/eth_wrappers.tsx index 58b73b11c..a6a1df751 100644 --- a/packages/website/ts/components/eth_wrappers.tsx +++ b/packages/website/ts/components/eth_wrappers.tsx @@ -13,10 +13,12 @@ import { } from 'material-ui/Table'; import * as moment from 'moment'; import * as React from 'react'; +import ReactTooltip = require('react-tooltip'); import {Blockchain} from 'ts/blockchain'; import {EthWethConversionButton} from 'ts/components/eth_weth_conversion_button'; import {Dispatcher} from 'ts/redux/dispatcher'; import { + EtherscanLinkSuffixes, OutdatedWrappedEtherByNetworkId, Side, Token, @@ -26,6 +28,7 @@ import { } from 'ts/types'; import {configs} from 'ts/utils/configs'; import {constants} from 'ts/utils/constants'; +import {utils} from 'ts/utils/utils'; const PRECISION = 5; const DATE_FORMAT = 'D/M/YY'; @@ -85,6 +88,10 @@ export class EthWrappers extends React.Component
@@ -131,8 +138,11 @@ export class EthWrappers extends React.Component -
- Ether +
+ ETH
@@ -153,15 +163,7 @@ export class EthWrappers extends React.Component -
- -
- Wrapped Ether -
-
+ {this.renderTokenLink(tokenLabel, etherscanUrl)}
{wethBalance.toFixed(PRECISION)} WETH @@ -264,18 +266,14 @@ export class EthWrappers extends React.Component -
- -
- {dateRange} -
-
+ {this.renderTokenLink(tokenLabel, etherscanUrl)}
{isStateLoaded ? @@ -301,6 +299,41 @@ export class EthWrappers extends React.Component + {_.isUndefined(etherscanUrl) ? + tokenLabel : + + {tokenLabel} + + } + + ); + } + private renderToken(name: string, address: string, imgPath: string) { + const tooltipId = `tooltip-${address}`; + return ( +
+ +
+ + {name} + + {address} +
+
+ ); + } private async onOutdatedConversionSuccessfulAsync(outdatedWETHAddress: string) { this.setState({ outdatedWETHAddressToIsStateLoaded: { -- cgit