From b054080fa1da88460f52021278fb33b8d88371a3 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Wed, 13 Dec 2017 19:45:44 -0600
Subject: Remove ETH-WETH convert button from balances page

---
 packages/website/ts/components/token_balances.tsx | 24 -----------------------
 1 file changed, 24 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index ae5ef9222..799fecc69 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -23,7 +23,6 @@ import * as React from 'react';
 import ReactTooltip = require('react-tooltip');
 import firstBy = require('thenby');
 import {Blockchain} from 'ts/blockchain';
-import {EthWethConversionButton} from 'ts/components/eth_weth_conversion_button';
 import {AssetPicker} from 'ts/components/generate_order/asset_picker';
 import {AllowanceToggle} from 'ts/components/inputs/allowance_toggle';
 import {SendButton} from 'ts/components/send_button';
@@ -425,16 +424,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             onClickAsyncFn={this.onMintTestTokensAsync.bind(this, token)}
                         />
                     }
-                    {token.symbol === ETHER_TOKEN_SYMBOL &&
-                        <EthWethConversionButton
-                            blockchain={this.props.blockchain}
-                            dispatcher={this.props.dispatcher}
-                            ethToken={this.getWrappedEthToken()}
-                            ethTokenState={tokenState}
-                            userEtherBalance={this.props.userEtherBalance}
-                            onError={this.onEthWethConversionFailed.bind(this)}
-                        />
-                    }
                     {token.symbol === ZRX_TOKEN_SYMBOL && this.props.networkId === constants.TESTNET_NETWORK_ID &&
                         <LifeCycleRaisedButton
                             labelReady="Request"
@@ -488,11 +477,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             isTokenPickerOpen: false,
         });
     }
-    private onEthWethConversionFailed() {
-        this.setState({
-            errorType: BalanceErrs.wethConversionFailed,
-        });
-    }
     private onSendFailed() {
         this.setState({
             errorType: BalanceErrs.sendFailed,
@@ -551,14 +535,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                     </div>
                 );
 
-            case BalanceErrs.wethConversionFailed:
-                return (
-                    <div>
-                        Converting between Ether and Ether Tokens failed unexpectedly.
-                        Please refresh the page and try again.
-                    </div>
-                );
-
             case BalanceErrs.allowanceSettingFailed:
                 return (
                     <div>
-- 
cgit 


From 2041e9945edf6f5255185de73c0dc332270e4bbb Mon Sep 17 00:00:00 2001
From: Leonid Logvinov <logvinov.leon@gmail.com>
Date: Fri, 15 Dec 2017 15:19:19 +0100
Subject: Fix website unused vars

---
 packages/website/ts/components/token_balances.tsx | 1 -
 1 file changed, 1 deletion(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index ae5ef9222..478114516 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -18,7 +18,6 @@ import {
     TableRow,
     TableRowColumn,
 } from 'material-ui/Table';
-import QueryString = require('query-string');
 import * as React from 'react';
 import ReactTooltip = require('react-tooltip');
 import firstBy = require('thenby');
-- 
cgit 


From c8e52882ca556ea06696a56e312f69284f99aa29 Mon Sep 17 00:00:00 2001
From: Leonid Logvinov <logvinov.leon@gmail.com>
Date: Fri, 15 Dec 2017 18:26:45 +0100
Subject: Fix redundant spaces

---
 packages/website/ts/components/token_balances.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 478114516..b68081c37 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -576,7 +576,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
     private renderDharmaLoanFrame() {
         if (utils.isUserOnMobile()) {
             return (
-                <h4 style={{ textAlign: 'center' }}>
+                <h4 style={{textAlign: 'center'}}>
                     We apologize -- Dharma loan requests are not available on
                     mobile yet.  Please try again through your desktop browser.
                 </h4>
-- 
cgit 


From 13279f1f20cb0eeb95c09781bba4280b31ffd210 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Fri, 15 Dec 2017 12:47:16 -0600
Subject: Fix linter errors

---
 packages/website/ts/components/token_balances.tsx | 5 -----
 1 file changed, 5 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index ab232326a..db4a35062 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -655,11 +655,6 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             isDharmaDialogVisible: !this.state.isDharmaDialogVisible,
         });
     }
-    private getWrappedEthToken() {
-        const tokens = _.values(this.props.tokenByAddress);
-        const wrappedEthToken = _.find(tokens, {symbol: ETHER_TOKEN_SYMBOL});
-        return wrappedEthToken;
-    }
     private onAddTokenClicked() {
         this.setState({
             isTokenPickerOpen: true,
-- 
cgit 


From 22c4ee6ef709610155191c4b0629ba0c41ce908f Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Sun, 17 Dec 2017 19:35:24 -0500
Subject: Update first two string enums to native type

---
 packages/website/ts/components/token_balances.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index db4a35062..dd7a722f5 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -357,7 +357,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         );
     }
     private renderTokenTableRows() {
-        if (!this.props.blockchainIsLoaded || this.props.blockchainErr !== '') {
+        if (!this.props.blockchainIsLoaded || this.props.blockchainErr !== BlockchainErrs.NoError) {
             return '';
         }
         const isSmallScreen = this.props.screenWidth === ScreenWidths.SM;
-- 
cgit 


From abbad68eb838ec4611d2236a7b0036a4a4d3058e Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Sun, 17 Dec 2017 20:48:23 -0500
Subject: Replace remaining strEnums with property TS string enums

---
 packages/website/ts/components/token_balances.tsx | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index dd7a722f5..5338e9609 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -156,7 +156,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         const tokenTableHeight = allTokenRowHeight < MAX_TOKEN_TABLE_HEIGHT ?
                                  allTokenRowHeight :
                                  MAX_TOKEN_TABLE_HEIGHT;
-        const isSmallScreen = this.props.screenWidth === ScreenWidths.SM;
+        const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
         const tokenColSpan = isSmallScreen ? TOKEN_COL_SPAN_SM : TOKEN_COL_SPAN_LG;
         const dharmaLoanExplanation = 'If you need access to larger amounts of ether,<br> \
                                      you can request a loan from the Dharma Loan<br> \
@@ -311,7 +311,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             <TableHeaderColumn>
                                 Action
                             </TableHeaderColumn>
-                            {this.props.screenWidth !== ScreenWidths.SM &&
+                            {this.props.screenWidth !== ScreenWidths.Sm &&
                                 <TableHeaderColumn>
                                     Send
                                 </TableHeaderColumn>
@@ -360,7 +360,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         if (!this.props.blockchainIsLoaded || this.props.blockchainErr !== BlockchainErrs.NoError) {
             return '';
         }
-        const isSmallScreen = this.props.screenWidth === ScreenWidths.SM;
+        const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
         const tokenColSpan = isSmallScreen ? TOKEN_COL_SPAN_SM : TOKEN_COL_SPAN_LG;
         const actionPaddingX = isSmallScreen ? 2 : 24;
         const allTokens = _.values(this.props.tokenByAddress);
@@ -379,7 +379,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
     private renderTokenRow(tokenColSpan: number, actionPaddingX: number, token: Token) {
         const tokenState = this.props.tokenStateByAddress[token.address];
         const tokenLink = utils.getEtherScanLinkIfExists(token.address, this.props.networkId,
-                                                         EtherscanLinkSuffixes.address);
+                                                         EtherscanLinkSuffixes.Address);
         const isMintable = _.includes(configs.symbolsOfMintableTokens, token.symbol) &&
             this.props.networkId !== constants.MAINNET_NETWORK_ID;
         return (
@@ -432,7 +432,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                         />
                     }
                 </TableRowColumn>
-                {this.props.screenWidth !== ScreenWidths.SM &&
+                {this.props.screenWidth !== ScreenWidths.Sm &&
                     <TableRowColumn
                         style={{paddingLeft: actionPaddingX, paddingRight: actionPaddingX}}
                     >
@@ -580,7 +580,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             return true;
         } catch (err) {
             const errMsg = '' + err;
-            if (_.includes(errMsg, BlockchainCallErrs.USER_HAS_NO_ASSOCIATED_ADDRESSES)) {
+            if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) {
                 this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
                 return false;
             }
-- 
cgit 


From 0578116f1dbe89a5b3c0c7e5f45948a1434b07b3 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Sun, 17 Dec 2017 20:51:54 -0500
Subject: Fix unhoverable help tooltip by renaming `Trade Permissions` to
 `Allowance`

---
 packages/website/ts/components/token_balances.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 5338e9609..b111e1ec6 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -164,7 +164,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                                      minutes or less.';
         const allowanceExplanation = '0x smart contracts require access to your<br> \
                                   token balances in order to execute trades.<br> \
-                                  Toggling permissions sets an allowance for the<br> \
+                                  Toggling sets an allowance for the<br> \
                                   smart contract so you can start trading that token.';
         return (
             <div className="lg-px4 md-px4 sm-px1 pb2">
@@ -302,7 +302,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             </TableHeaderColumn>
                             <TableHeaderColumn style={{paddingLeft: 3}}>Balance</TableHeaderColumn>
                             <TableHeaderColumn>
-                                <div className="inline-block">{!isSmallScreen && 'Trade '}Permissions</div>
+                                <div className="inline-block">Allowance</div>
                                 <HelpTooltip
                                     style={{paddingLeft: 4}}
                                     explanation={allowanceExplanation}
-- 
cgit 


From df9d3e3e16e5a00ea84369691c46a6e4a6a53049 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Mon, 18 Dec 2017 09:15:12 +0100
Subject: Consolidate all custom colors and material-ui colors into a colors
 module

---
 packages/website/ts/components/token_balances.tsx | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index b111e1ec6..a3c577a2e 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -7,7 +7,7 @@ import Divider from 'material-ui/Divider';
 import FlatButton from 'material-ui/FlatButton';
 import FloatingActionButton from 'material-ui/FloatingActionButton';
 import RaisedButton from 'material-ui/RaisedButton';
-import {colors} from 'material-ui/styles';
+import {colors} from 'ts/utils/colors';
 import ContentAdd from 'material-ui/svg-icons/content/add';
 import ContentRemove from 'material-ui/svg-icons/content/remove';
 import {
@@ -333,9 +333,9 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 </Dialog>
                 <Dialog
                     title="Request Dharma Loan"
-                    titleStyle={{fontWeight: 100, backgroundColor: 'rgb(250, 250, 250)'}}
-                    bodyStyle={{backgroundColor: 'rgb(37, 37, 37)'}}
-                    actionsContainerStyle={{backgroundColor: 'rgb(250, 250, 250)'}}
+                    titleStyle={{fontWeight: 100, backgroundColor: colors.white}}
+                    bodyStyle={{backgroundColor: colors.dharmaDarkGray}}
+                    actionsContainerStyle={{backgroundColor: colors.white}}
                     autoScrollBodyContent={true}
                     actions={dharmaDialogActions}
                     open={this.state.isDharmaDialogVisible}
-- 
cgit 


From 1aed970ce3468306f3bedbfdc29669d42e487441 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Mon, 18 Dec 2017 10:28:34 +0100
Subject: standarize on `grey` over `gray` spelling and other color related
 fixes

---
 packages/website/ts/components/token_balances.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index a3c577a2e..61aea6a88 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -7,7 +7,6 @@ import Divider from 'material-ui/Divider';
 import FlatButton from 'material-ui/FlatButton';
 import FloatingActionButton from 'material-ui/FloatingActionButton';
 import RaisedButton from 'material-ui/RaisedButton';
-import {colors} from 'ts/utils/colors';
 import ContentAdd from 'material-ui/svg-icons/content/add';
 import ContentRemove from 'material-ui/svg-icons/content/remove';
 import {
@@ -42,6 +41,7 @@ import {
     TokenStateByAddress,
     TokenVisibility,
 } from 'ts/types';
+import {colors} from 'ts/utils/colors';
 import {configs} from 'ts/utils/configs';
 import {constants} from 'ts/utils/constants';
 import {errorReporter} from 'ts/utils/error_reporter';
@@ -334,7 +334,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 <Dialog
                     title="Request Dharma Loan"
                     titleStyle={{fontWeight: 100, backgroundColor: colors.white}}
-                    bodyStyle={{backgroundColor: colors.dharmaDarkGray}}
+                    bodyStyle={{backgroundColor: colors.dharmaDarkGrey}}
                     actionsContainerStyle={{backgroundColor: colors.white}}
                     autoScrollBodyContent={true}
                     actions={dharmaDialogActions}
-- 
cgit 


From fb0b7efc4563c7c561866ab8691361ce6919160b Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Mon, 18 Dec 2017 19:30:25 +0100
Subject: Refactor configs and constants, standardize on uppercase/snakecase,
 alphebetize, rename for logical grouping

---
 packages/website/ts/components/token_balances.tsx | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 61aea6a88..ecaf63af9 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -115,7 +115,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         if (!_.isUndefined(this.state.currentZrxBalance) && !nextZrxTokenBalance.eq(this.state.currentZrxBalance)) {
             if (this.state.isZRXSpinnerVisible) {
                 const receivedAmount = nextZrxTokenBalance.minus(this.state.currentZrxBalance);
-                const receiveAmountInUnits = ZeroEx.toUnitAmount(receivedAmount, 18);
+                const receiveAmountInUnits = ZeroEx.toUnitAmount(receivedAmount, constants.DECIMAL_PLACES_ZRX);
                 this.props.dispatcher.showFlashMessage(`Received ${receiveAmountInUnits.toString(10)} Kovan ZRX`);
             }
             this.setState({
@@ -144,7 +144,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 onTouchTap={this.onDharmaDialogToggle.bind(this, false)}
             />,
         ];
-        const isTestNetwork = this.props.networkId === constants.TESTNET_NETWORK_ID;
+        const isTestNetwork = this.props.networkId === constants.NETWORK_ID_TESTNET;
         const dharmaButtonColumnStyle = {
             paddingLeft: 3,
             display: isTestNetwork ? 'table-cell' : 'none',
@@ -380,8 +380,8 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         const tokenState = this.props.tokenStateByAddress[token.address];
         const tokenLink = utils.getEtherScanLinkIfExists(token.address, this.props.networkId,
                                                          EtherscanLinkSuffixes.Address);
-        const isMintable = _.includes(configs.symbolsOfMintableTokens, token.symbol) &&
-            this.props.networkId !== constants.MAINNET_NETWORK_ID;
+        const isMintable = _.includes(configs.SYMBOLS_OF_MINTABLE_TOKENS, token.symbol) &&
+            this.props.networkId !== constants.NETWORK_ID_MAINNET;
         return (
             <TableRow key={token.address} style={{height: TOKEN_TABLE_ROW_HEIGHT}}>
                 <TableRowColumn
@@ -423,7 +423,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             onClickAsyncFn={this.onMintTestTokensAsync.bind(this, token)}
                         />
                     }
-                    {token.symbol === ZRX_TOKEN_SYMBOL && this.props.networkId === constants.TESTNET_NETWORK_ID &&
+                    {token.symbol === ZRX_TOKEN_SYMBOL && this.props.networkId === constants.NETWORK_ID_TESTNET &&
                         <LifeCycleRaisedButton
                             labelReady="Request"
                             labelLoading="Sending..."
@@ -456,7 +456,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             return;
         }
         const token = this.props.tokenByAddress[tokenAddress];
-        const isDefaultTrackedToken = _.includes(configs.defaultTrackedTokenSymbols, token.symbol);
+        const isDefaultTrackedToken = _.includes(configs.DEFAULT_TRACKED_TOKEN_SYMBOLS, token.symbol);
         if (!this.state.isAddingToken && !isDefaultTrackedToken) {
             if (token.isRegistered) {
                 // Remove the token from tracked tokens
@@ -507,7 +507,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 return (
                     <div>
                         Our faucet can only send test Ether to addresses on the {constants.TESTNET_NAME}
-                        {' '}testnet (networkId {constants.TESTNET_NETWORK_ID}). Please make sure you are
+                        {' '}testnet (networkId {constants.NETWORK_ID_TESTNET}). Please make sure you are
                         {' '}connected to the {constants.TESTNET_NAME} testnet and try requesting ether again.
                     </div>
                 );
@@ -604,7 +604,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
 
         // If on another network other then the testnet our faucet serves test ether
         // from, we must show user an error message
-        if (this.props.blockchain.networkId !== constants.TESTNET_NETWORK_ID) {
+        if (this.props.blockchain.networkId !== constants.NETWORK_ID_TESTNET) {
             this.setState({
                 errorType: BalanceErrs.incorrectNetworkForFaucet,
             });
@@ -614,7 +614,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         await utils.sleepAsync(ARTIFICIAL_FAUCET_REQUEST_DELAY);
 
         const segment = isEtherRequest ? 'ether' : 'zrx';
-        const response = await fetch(`${constants.ETHER_FAUCET_ENDPOINT}/${segment}/${this.props.userAddress}`);
+        const response = await fetch(`${constants.URL_ETHER_FAUCET}/${segment}/${this.props.userAddress}`);
         const responseBody = await response.text();
         if (response.status !== constants.SUCCESS_STATUS) {
             utils.consoleLog(`Unexpected status code: ${response.status} -> ${responseBody}`);
-- 
cgit 


From b7004b30029f26e3a556676f5e713ba23cd5151d Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Tue, 19 Dec 2017 11:25:50 +0100
Subject: Refactor remaining _.assign to spread operator

---
 packages/website/ts/components/token_balances.tsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index ecaf63af9..ab4b04868 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -460,9 +460,10 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         if (!this.state.isAddingToken && !isDefaultTrackedToken) {
             if (token.isRegistered) {
                 // Remove the token from tracked tokens
-                const newToken = _.assign({}, token, {
+                const newToken = {
+                    ...token,
                     isTracked: false,
-                });
+                };
                 this.props.dispatcher.updateTokenByAddress([newToken]);
             } else {
                 this.props.dispatcher.removeTokenToTokenByAddress(token);
-- 
cgit 


From cb11aec84df346d5180c7d5874859c1c34f0bf1c Mon Sep 17 00:00:00 2001
From: Brandon Millman <brandon.millman@gmail.com>
Date: Wed, 20 Dec 2017 00:44:08 -0500
Subject: Add new underscore-privates rule to @0xproject/tslint-config and fix
 lint errors

---
 packages/website/ts/components/token_balances.tsx | 68 +++++++++++------------
 1 file changed, 34 insertions(+), 34 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index ab4b04868..695cb05d8 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -133,7 +133,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 key="errorOkBtn"
                 label="Ok"
                 primary={true}
-                onTouchTap={this.onErrorDialogToggle.bind(this, false)}
+                onTouchTap={this._onErrorDialogToggle.bind(this, false)}
             />,
         ];
         const dharmaDialogActions = [
@@ -141,7 +141,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 key="dharmaCloseBtn"
                 label="Close"
                 primary={true}
-                onTouchTap={this.onDharmaDialogToggle.bind(this, false)}
+                onTouchTap={this._onDharmaDialogToggle.bind(this, false)}
             />,
         ];
         const isTestNetwork = this.props.networkId === constants.NETWORK_ID_TESTNET;
@@ -239,7 +239,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                                         labelReady="Request"
                                         labelLoading="Sending..."
                                         labelComplete="Sent!"
-                                        onClickAsyncFn={this.faucetRequestAsync.bind(this, true)}
+                                        onClickAsyncFn={this._faucetRequestAsync.bind(this, true)}
                                     />
                                 </TableRowColumn>
                             }
@@ -249,7 +249,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                                     <RaisedButton
                                         label="Request"
                                         style={{width: '100%'}}
-                                        onTouchTap={this.onDharmaDialogToggle.bind(this)}
+                                        onTouchTap={this._onDharmaDialogToggle.bind(this)}
                                     />
                                 </TableRowColumn>
                             }
@@ -266,7 +266,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                         <FloatingActionButton
                             mini={true}
                             zDepth={0}
-                            onClick={this.onAddTokenClicked.bind(this)}
+                            onClick={this._onAddTokenClicked.bind(this)}
                         >
                             <ContentAdd />
                         </FloatingActionButton>
@@ -275,7 +275,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                         <FloatingActionButton
                             mini={true}
                             zDepth={0}
-                            onClick={this.onRemoveTokenClicked.bind(this)}
+                            onClick={this._onRemoveTokenClicked.bind(this)}
                         >
                             <ContentRemove />
                         </FloatingActionButton>
@@ -319,7 +319,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                         </TableRow>
                     </TableHeader>
                     <TableBody displayRowCheckbox={false}>
-                        {this.renderTokenTableRows()}
+                        {this._renderTokenTableRows()}
                     </TableBody>
                 </Table>
                 <Dialog
@@ -327,9 +327,9 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                     titleStyle={{fontWeight: 100}}
                     actions={errorDialogActions}
                     open={!_.isUndefined(this.state.errorType)}
-                    onRequestClose={this.onErrorDialogToggle.bind(this, false)}
+                    onRequestClose={this._onErrorDialogToggle.bind(this, false)}
                 >
-                    {this.renderErrorDialogBody()}
+                    {this._renderErrorDialogBody()}
                 </Dialog>
                 <Dialog
                     title="Request Dharma Loan"
@@ -340,7 +340,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                     actions={dharmaDialogActions}
                     open={this.state.isDharmaDialogVisible}
                 >
-                    {this.renderDharmaLoanFrame()}
+                    {this._renderDharmaLoanFrame()}
                 </Dialog>
                 <AssetPicker
                     userAddress={this.props.userAddress}
@@ -349,14 +349,14 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                     dispatcher={this.props.dispatcher}
                     isOpen={this.state.isTokenPickerOpen}
                     currentTokenAddress={''}
-                    onTokenChosen={this.onAssetTokenPicked.bind(this)}
+                    onTokenChosen={this._onAssetTokenPicked.bind(this)}
                     tokenByAddress={this.props.tokenByAddress}
                     tokenVisibility={this.state.isAddingToken ? TokenVisibility.UNTRACKED : TokenVisibility.TRACKED}
                 />
             </div>
         );
     }
-    private renderTokenTableRows() {
+    private _renderTokenTableRows() {
         if (!this.props.blockchainIsLoaded || this.props.blockchainErr !== BlockchainErrs.NoError) {
             return '';
         }
@@ -372,11 +372,11 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         );
         const tableRows = _.map(
             trackedTokensStartingWithEtherToken,
-            this.renderTokenRow.bind(this, tokenColSpan, actionPaddingX),
+            this._renderTokenRow.bind(this, tokenColSpan, actionPaddingX),
         );
         return tableRows;
     }
-    private renderTokenRow(tokenColSpan: number, actionPaddingX: number, token: Token) {
+    private _renderTokenRow(tokenColSpan: number, actionPaddingX: number, token: Token) {
         const tokenState = this.props.tokenStateByAddress[token.address];
         const tokenLink = utils.getEtherScanLinkIfExists(token.address, this.props.networkId,
                                                          EtherscanLinkSuffixes.Address);
@@ -388,14 +388,14 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                     colSpan={tokenColSpan}
                 >
                     {_.isUndefined(tokenLink) ?
-                        this.renderTokenName(token) :
+                        this._renderTokenName(token) :
                         <a href={tokenLink} target="_blank" style={{textDecoration: 'none'}}>
-                            {this.renderTokenName(token)}
+                            {this._renderTokenName(token)}
                         </a>
                     }
                 </TableRowColumn>
                 <TableRowColumn style={{paddingRight: 3, paddingLeft: 3}}>
-                    {this.renderAmount(tokenState.balance, token.decimals)} {token.symbol}
+                    {this._renderAmount(tokenState.balance, token.decimals)} {token.symbol}
                     {this.state.isZRXSpinnerVisible && token.symbol === ZRX_TOKEN_SYMBOL &&
                         <span className="pl1">
                             <i className="zmdi zmdi-spinner zmdi-hc-spin" />
@@ -408,7 +408,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                         dispatcher={this.props.dispatcher}
                         token={token}
                         tokenState={tokenState}
-                        onErrorOccurred={this.onErrorOccurred.bind(this)}
+                        onErrorOccurred={this._onErrorOccurred.bind(this)}
                         userAddress={this.props.userAddress}
                     />
                 </TableRowColumn>
@@ -420,7 +420,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             labelReady="Mint"
                             labelLoading={<span style={{fontSize: 12}}>Minting...</span>}
                             labelComplete="Minted!"
-                            onClickAsyncFn={this.onMintTestTokensAsync.bind(this, token)}
+                            onClickAsyncFn={this._onMintTestTokensAsync.bind(this, token)}
                         />
                     }
                     {token.symbol === ZRX_TOKEN_SYMBOL && this.props.networkId === constants.NETWORK_ID_TESTNET &&
@@ -428,7 +428,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             labelReady="Request"
                             labelLoading="Sending..."
                             labelComplete="Sent!"
-                            onClickAsyncFn={this.faucetRequestAsync.bind(this, false)}
+                            onClickAsyncFn={this._faucetRequestAsync.bind(this, false)}
                         />
                     }
                 </TableRowColumn>
@@ -441,14 +441,14 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             dispatcher={this.props.dispatcher}
                             token={token}
                             tokenState={tokenState}
-                            onError={this.onSendFailed.bind(this)}
+                            onError={this._onSendFailed.bind(this)}
                         />
                     </TableRowColumn>
                 }
             </TableRow>
         );
     }
-    private onAssetTokenPicked(tokenAddress: string) {
+    private _onAssetTokenPicked(tokenAddress: string) {
         if (_.isEmpty(tokenAddress)) {
             this.setState({
                 isTokenPickerOpen: false,
@@ -477,16 +477,16 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             isTokenPickerOpen: false,
         });
     }
-    private onSendFailed() {
+    private _onSendFailed() {
         this.setState({
             errorType: BalanceErrs.sendFailed,
         });
     }
-    private renderAmount(amount: BigNumber, decimals: number) {
+    private _renderAmount(amount: BigNumber, decimals: number) {
         const unitAmount = ZeroEx.toUnitAmount(amount, decimals);
         return unitAmount.toNumber().toFixed(PRECISION);
     }
-    private renderTokenName(token: Token) {
+    private _renderTokenName(token: Token) {
         const tooltipId = `tooltip-${token.address}`;
         return (
             <div className="flex">
@@ -502,7 +502,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             </div>
         );
     }
-    private renderErrorDialogBody() {
+    private _renderErrorDialogBody() {
         switch (this.state.errorType) {
             case BalanceErrs.incorrectNetworkForFaucet:
                 return (
@@ -550,7 +550,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 throw utils.spawnSwitchErr('errorType', this.state.errorType);
         }
     }
-    private renderDharmaLoanFrame() {
+    private _renderDharmaLoanFrame() {
         if (utils.isUserOnMobile()) {
             return (
                 <h4 style={{textAlign: 'center'}}>
@@ -568,12 +568,12 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             );
         }
     }
-    private onErrorOccurred(errorType: BalanceErrs) {
+    private _onErrorOccurred(errorType: BalanceErrs) {
         this.setState({
             errorType,
         });
     }
-    private async onMintTestTokensAsync(token: Token): Promise<boolean> {
+    private async _onMintTestTokensAsync(token: Token): Promise<boolean> {
         try {
             await this.props.blockchain.mintTestTokensAsync(token);
             const amount = ZeroEx.toUnitAmount(constants.MINT_AMOUNT, token.decimals);
@@ -597,7 +597,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             return false;
         }
     }
-    private async faucetRequestAsync(isEtherRequest: boolean): Promise<boolean> {
+    private async _faucetRequestAsync(isEtherRequest: boolean): Promise<boolean> {
         if (this.props.userAddress === '') {
             this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
             return false;
@@ -646,23 +646,23 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         }
         return true;
     }
-    private onErrorDialogToggle(isOpen: boolean) {
+    private _onErrorDialogToggle(isOpen: boolean) {
         this.setState({
             errorType: undefined,
         });
     }
-    private onDharmaDialogToggle() {
+    private _onDharmaDialogToggle() {
         this.setState({
             isDharmaDialogVisible: !this.state.isDharmaDialogVisible,
         });
     }
-    private onAddTokenClicked() {
+    private _onAddTokenClicked() {
         this.setState({
             isTokenPickerOpen: true,
             isAddingToken: true,
         });
     }
-    private onRemoveTokenClicked() {
+    private _onRemoveTokenClicked() {
         this.setState({
             isTokenPickerOpen: true,
             isAddingToken: false,
-- 
cgit 


From 42b3a7c9d756dd2c68256707c0c96a95370329bd Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Wed, 20 Dec 2017 18:36:12 +0100
Subject: Move call to error reporter to end of handler so that even if
 reporting the error takes a while, it doesn't block the UI

---
 packages/website/ts/components/token_balances.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index ab4b04868..2e2ad74e3 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -590,10 +590,10 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             }
             utils.consoleLog(`Unexpected error encountered: ${err}`);
             utils.consoleLog(err.stack);
-            await errorReporter.reportAsync(err);
             this.setState({
                 errorType: BalanceErrs.mintingFailed,
             });
+            await errorReporter.reportAsync(err);
             return false;
         }
     }
@@ -619,13 +619,13 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         const responseBody = await response.text();
         if (response.status !== constants.SUCCESS_STATUS) {
             utils.consoleLog(`Unexpected status code: ${response.status} -> ${responseBody}`);
-            await errorReporter.reportAsync(new Error(`Faucet returned non-200: ${JSON.stringify(response)}`));
             const errorType = response.status === constants.UNAVAILABLE_STATUS ?
                               BalanceErrs.faucetQueueIsFull :
                               BalanceErrs.faucetRequestFailed;
             this.setState({
                 errorType,
             });
+            await errorReporter.reportAsync(new Error(`Faucet returned non-200: ${JSON.stringify(response)}`));
             return false;
         }
 
-- 
cgit 


From e744e4cd989bd3ae1070c59f7baa8097f18b8b06 Mon Sep 17 00:00:00 2001
From: Leonid Logvinov <logvinov.leon@gmail.com>
Date: Fri, 22 Dec 2017 15:05:32 +0100
Subject: Apply prettier config

---
 packages/website/ts/components/token_balances.tsx | 313 +++++++++-------------
 1 file changed, 124 insertions(+), 189 deletions(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 208cd54e1..913eb8a78 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -1,4 +1,4 @@
-import {ZeroEx} from '0x.js';
+import { ZeroEx } from '0x.js';
 import BigNumber from 'bignumber.js';
 import DharmaLoanFrame from 'dharma-loan-frame';
 import * as _ from 'lodash';
@@ -9,26 +9,19 @@ import FloatingActionButton from 'material-ui/FloatingActionButton';
 import RaisedButton from 'material-ui/RaisedButton';
 import ContentAdd from 'material-ui/svg-icons/content/add';
 import ContentRemove from 'material-ui/svg-icons/content/remove';
-import {
-    Table,
-    TableBody,
-    TableHeader,
-    TableHeaderColumn,
-    TableRow,
-    TableRowColumn,
-} from 'material-ui/Table';
+import { Table, TableBody, TableHeader, TableHeaderColumn, TableRow, TableRowColumn } from 'material-ui/Table';
 import * as React from 'react';
 import ReactTooltip = require('react-tooltip');
 import firstBy = require('thenby');
-import {Blockchain} from 'ts/blockchain';
-import {AssetPicker} from 'ts/components/generate_order/asset_picker';
-import {AllowanceToggle} from 'ts/components/inputs/allowance_toggle';
-import {SendButton} from 'ts/components/send_button';
-import {HelpTooltip} from 'ts/components/ui/help_tooltip';
-import {LifeCycleRaisedButton} from 'ts/components/ui/lifecycle_raised_button';
-import {TokenIcon} from 'ts/components/ui/token_icon';
-import {trackedTokenStorage} from 'ts/local_storage/tracked_token_storage';
-import {Dispatcher} from 'ts/redux/dispatcher';
+import { Blockchain } from 'ts/blockchain';
+import { AssetPicker } from 'ts/components/generate_order/asset_picker';
+import { AllowanceToggle } from 'ts/components/inputs/allowance_toggle';
+import { SendButton } from 'ts/components/send_button';
+import { HelpTooltip } from 'ts/components/ui/help_tooltip';
+import { LifeCycleRaisedButton } from 'ts/components/ui/lifecycle_raised_button';
+import { TokenIcon } from 'ts/components/ui/token_icon';
+import { trackedTokenStorage } from 'ts/local_storage/tracked_token_storage';
+import { Dispatcher } from 'ts/redux/dispatcher';
 import {
     BalanceErrs,
     BlockchainCallErrs,
@@ -41,11 +34,11 @@ import {
     TokenStateByAddress,
     TokenVisibility,
 } from 'ts/types';
-import {colors} from 'ts/utils/colors';
-import {configs} from 'ts/utils/configs';
-import {constants} from 'ts/utils/constants';
-import {errorReporter} from 'ts/utils/error_reporter';
-import {utils} from 'ts/utils/utils';
+import { colors } from 'ts/utils/colors';
+import { configs } from 'ts/utils/configs';
+import { constants } from 'ts/utils/constants';
+import { errorReporter } from 'ts/utils/error_reporter';
+import { utils } from 'ts/utils/utils';
 
 const ETHER_ICON_PATH = '/images/ether.png';
 const ETHER_TOKEN_SYMBOL = 'WETH';
@@ -153,16 +146,17 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             display: isTestNetwork ? 'none' : 'table-cell',
         };
         const allTokenRowHeight = _.size(this.props.tokenByAddress) * TOKEN_TABLE_ROW_HEIGHT;
-        const tokenTableHeight = allTokenRowHeight < MAX_TOKEN_TABLE_HEIGHT ?
-                                 allTokenRowHeight :
-                                 MAX_TOKEN_TABLE_HEIGHT;
+        const tokenTableHeight =
+            allTokenRowHeight < MAX_TOKEN_TABLE_HEIGHT ? allTokenRowHeight : MAX_TOKEN_TABLE_HEIGHT;
         const isSmallScreen = this.props.screenWidth === ScreenWidths.Sm;
         const tokenColSpan = isSmallScreen ? TOKEN_COL_SPAN_SM : TOKEN_COL_SPAN_LG;
-        const dharmaLoanExplanation = 'If you need access to larger amounts of ether,<br> \
+        const dharmaLoanExplanation =
+            'If you need access to larger amounts of ether,<br> \
                                      you can request a loan from the Dharma Loan<br> \
                                      network.  Your loan should be funded in 5<br>  \
                                      minutes or less.';
-        const allowanceExplanation = '0x smart contracts require access to your<br> \
+        const allowanceExplanation =
+            '0x smart contracts require access to your<br> \
                                   token balances in order to execute trades.<br> \
                                   Toggling sets an allowance for the<br> \
                                   smart contract so you can start trading that token.';
@@ -171,70 +165,47 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 <h3>{isTestNetwork ? 'Test ether' : 'Ether'}</h3>
                 <Divider />
                 <div className="pt2 pb2">
-                    {isTestNetwork ?
-                        'In order to try out the 0x Portal Dapp, request some test ether to pay for \
-                        gas costs. It might take a bit of time for the test ether to show up.' :
-                        'Ether must be converted to Ether Tokens in order to be tradable via 0x. \
-                         You can convert between Ether and Ether Tokens by clicking the "convert" button below.'
-                    }
+                    {isTestNetwork
+                        ? 'In order to try out the 0x Portal Dapp, request some test ether to pay for \
+                        gas costs. It might take a bit of time for the test ether to show up.'
+                        : 'Ether must be converted to Ether Tokens in order to be tradable via 0x. \
+                         You can convert between Ether and Ether Tokens by clicking the "convert" button below.'}
                 </div>
-                <Table
-                    selectable={false}
-                    style={styles.bgColor}
-                >
+                <Table selectable={false} style={styles.bgColor}>
                     <TableHeader displaySelectAll={false} adjustForCheckbox={false}>
                         <TableRow>
                             <TableHeaderColumn>Currency</TableHeaderColumn>
                             <TableHeaderColumn>Balance</TableHeaderColumn>
-                            <TableRowColumn
-                                className="sm-hide xs-hide"
-                                style={stubColumnStyle}
-                            />
-                            {
-                                isTestNetwork &&
-                                <TableHeaderColumn
-                                    style={{paddingLeft: 3}}
-                                >
+                            <TableRowColumn className="sm-hide xs-hide" style={stubColumnStyle} />
+                            {isTestNetwork && (
+                                <TableHeaderColumn style={{ paddingLeft: 3 }}>
                                     {isSmallScreen ? 'Faucet' : 'Request from faucet'}
                                 </TableHeaderColumn>
-                            }
-                            {
-                                isTestNetwork &&
-                                <TableHeaderColumn
-                                    style={dharmaButtonColumnStyle}
-                                >
+                            )}
+                            {isTestNetwork && (
+                                <TableHeaderColumn style={dharmaButtonColumnStyle}>
                                     {isSmallScreen ? 'Loan' : 'Request Dharma loan'}
-                                    <HelpTooltip
-                                        style={{paddingLeft: 4}}
-                                        explanation={dharmaLoanExplanation}
-                                    />
+                                    <HelpTooltip style={{ paddingLeft: 4 }} explanation={dharmaLoanExplanation} />
                                 </TableHeaderColumn>
-                            }
+                            )}
                         </TableRow>
                     </TableHeader>
                     <TableBody displayRowCheckbox={false}>
                         <TableRow key="ETH">
                             <TableRowColumn className="py1">
-                                <img
-                                    style={{width: ICON_DIMENSION, height: ICON_DIMENSION}}
-                                    src={ETHER_ICON_PATH}
-                                />
+                                <img style={{ width: ICON_DIMENSION, height: ICON_DIMENSION }} src={ETHER_ICON_PATH} />
                             </TableRowColumn>
                             <TableRowColumn>
                                 {this.props.userEtherBalance.toFixed(PRECISION)} ETH
-                                {this.state.isBalanceSpinnerVisible &&
+                                {this.state.isBalanceSpinnerVisible && (
                                     <span className="pl1">
                                         <i className="zmdi zmdi-spinner zmdi-hc-spin" />
                                     </span>
-                                }
+                                )}
                             </TableRowColumn>
-                            <TableRowColumn
-                                className="sm-hide xs-hide"
-                                style={stubColumnStyle}
-                            />
-                            {
-                                isTestNetwork &&
-                                <TableRowColumn style={{paddingLeft: 3}}>
+                            <TableRowColumn className="sm-hide xs-hide" style={stubColumnStyle} />
+                            {isTestNetwork && (
+                                <TableRowColumn style={{ paddingLeft: 3 }}>
                                     <LifeCycleRaisedButton
                                         labelReady="Request"
                                         labelLoading="Sending..."
@@ -242,89 +213,58 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                                         onClickAsyncFn={this._faucetRequestAsync.bind(this, true)}
                                     />
                                 </TableRowColumn>
-                            }
-                            {
-                                isTestNetwork &&
+                            )}
+                            {isTestNetwork && (
                                 <TableRowColumn style={dharmaButtonColumnStyle}>
                                     <RaisedButton
                                         label="Request"
-                                        style={{width: '100%'}}
+                                        style={{ width: '100%' }}
                                         onTouchTap={this._onDharmaDialogToggle.bind(this)}
                                     />
                                 </TableRowColumn>
-                            }
+                            )}
                         </TableRow>
                     </TableBody>
                 </Table>
-                <div className="clearfix" style={{paddingBottom: 1}}>
+                <div className="clearfix" style={{ paddingBottom: 1 }}>
                     <div className="col col-10">
-                        <h3 className="pt2">
-                            {isTestNetwork ? 'Test tokens' : 'Tokens'}
-                        </h3>
+                        <h3 className="pt2">{isTestNetwork ? 'Test tokens' : 'Tokens'}</h3>
                     </div>
                     <div className="col col-1 pt3 align-right">
-                        <FloatingActionButton
-                            mini={true}
-                            zDepth={0}
-                            onClick={this._onAddTokenClicked.bind(this)}
-                        >
+                        <FloatingActionButton mini={true} zDepth={0} onClick={this._onAddTokenClicked.bind(this)}>
                             <ContentAdd />
                         </FloatingActionButton>
                     </div>
                     <div className="col col-1 pt3 align-right">
-                        <FloatingActionButton
-                            mini={true}
-                            zDepth={0}
-                            onClick={this._onRemoveTokenClicked.bind(this)}
-                        >
+                        <FloatingActionButton mini={true} zDepth={0} onClick={this._onRemoveTokenClicked.bind(this)}>
                             <ContentRemove />
                         </FloatingActionButton>
                     </div>
                 </div>
                 <Divider />
                 <div className="pt2 pb2">
-                    {isTestNetwork ?
-                        'Mint some test tokens you\'d like to use to generate or fill an order using 0x.' :
-                        'Set trading permissions for a token you\'d like to start trading.'
-                    }
+                    {isTestNetwork
+                        ? "Mint some test tokens you'd like to use to generate or fill an order using 0x."
+                        : "Set trading permissions for a token you'd like to start trading."}
                 </div>
-                <Table
-                    selectable={false}
-                    bodyStyle={{height: tokenTableHeight}}
-                    style={styles.bgColor}
-                >
+                <Table selectable={false} bodyStyle={{ height: tokenTableHeight }} style={styles.bgColor}>
                     <TableHeader displaySelectAll={false} adjustForCheckbox={false}>
                         <TableRow>
-                            <TableHeaderColumn
-                                colSpan={tokenColSpan}
-                            >
-                                Token
-                            </TableHeaderColumn>
-                            <TableHeaderColumn style={{paddingLeft: 3}}>Balance</TableHeaderColumn>
+                            <TableHeaderColumn colSpan={tokenColSpan}>Token</TableHeaderColumn>
+                            <TableHeaderColumn style={{ paddingLeft: 3 }}>Balance</TableHeaderColumn>
                             <TableHeaderColumn>
                                 <div className="inline-block">Allowance</div>
-                                <HelpTooltip
-                                    style={{paddingLeft: 4}}
-                                    explanation={allowanceExplanation}
-                                />
+                                <HelpTooltip style={{ paddingLeft: 4 }} explanation={allowanceExplanation} />
                             </TableHeaderColumn>
-                            <TableHeaderColumn>
-                                Action
-                            </TableHeaderColumn>
-                            {this.props.screenWidth !== ScreenWidths.Sm &&
-                                <TableHeaderColumn>
-                                    Send
-                                </TableHeaderColumn>
-                            }
+                            <TableHeaderColumn>Action</TableHeaderColumn>
+                            {this.props.screenWidth !== ScreenWidths.Sm && <TableHeaderColumn>Send</TableHeaderColumn>}
                         </TableRow>
                     </TableHeader>
-                    <TableBody displayRowCheckbox={false}>
-                        {this._renderTokenTableRows()}
-                    </TableBody>
+                    <TableBody displayRowCheckbox={false}>{this._renderTokenTableRows()}</TableBody>
                 </Table>
                 <Dialog
                     title="Oh oh"
-                    titleStyle={{fontWeight: 100}}
+                    titleStyle={{ fontWeight: 100 }}
                     actions={errorDialogActions}
                     open={!_.isUndefined(this.state.errorType)}
                     onRequestClose={this._onErrorDialogToggle.bind(this, false)}
@@ -333,9 +273,9 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                 </Dialog>
                 <Dialog
                     title="Request Dharma Loan"
-                    titleStyle={{fontWeight: 100, backgroundColor: colors.white}}
-                    bodyStyle={{backgroundColor: colors.dharmaDarkGrey}}
-                    actionsContainerStyle={{backgroundColor: colors.white}}
+                    titleStyle={{ fontWeight: 100, backgroundColor: colors.white }}
+                    bodyStyle={{ backgroundColor: colors.dharmaDarkGrey }}
+                    actionsContainerStyle={{ backgroundColor: colors.white }}
                     autoScrollBodyContent={true}
                     actions={dharmaDialogActions}
                     open={this.state.isDharmaDialogVisible}
@@ -366,9 +306,9 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         const allTokens = _.values(this.props.tokenByAddress);
         const trackedTokens = _.filter(allTokens, t => t.isTracked);
         const trackedTokensStartingWithEtherToken = trackedTokens.sort(
-            firstBy((t: Token) => (t.symbol !== ETHER_TOKEN_SYMBOL))
-            .thenBy((t: Token) => (t.symbol !== ZRX_TOKEN_SYMBOL))
-            .thenBy('address'),
+            firstBy((t: Token) => t.symbol !== ETHER_TOKEN_SYMBOL)
+                .thenBy((t: Token) => t.symbol !== ZRX_TOKEN_SYMBOL)
+                .thenBy('address'),
         );
         const tableRows = _.map(
             trackedTokensStartingWithEtherToken,
@@ -378,29 +318,33 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
     }
     private _renderTokenRow(tokenColSpan: number, actionPaddingX: number, token: Token) {
         const tokenState = this.props.tokenStateByAddress[token.address];
-        const tokenLink = utils.getEtherScanLinkIfExists(token.address, this.props.networkId,
-                                                         EtherscanLinkSuffixes.Address);
-        const isMintable = _.includes(configs.SYMBOLS_OF_MINTABLE_TOKENS, token.symbol) &&
+        const tokenLink = utils.getEtherScanLinkIfExists(
+            token.address,
+            this.props.networkId,
+            EtherscanLinkSuffixes.Address,
+        );
+        const isMintable =
+            _.includes(configs.SYMBOLS_OF_MINTABLE_TOKENS, token.symbol) &&
             this.props.networkId !== constants.NETWORK_ID_MAINNET;
         return (
-            <TableRow key={token.address} style={{height: TOKEN_TABLE_ROW_HEIGHT}}>
-                <TableRowColumn
-                    colSpan={tokenColSpan}
-                >
-                    {_.isUndefined(tokenLink) ?
-                        this._renderTokenName(token) :
-                        <a href={tokenLink} target="_blank" style={{textDecoration: 'none'}}>
+            <TableRow key={token.address} style={{ height: TOKEN_TABLE_ROW_HEIGHT }}>
+                <TableRowColumn colSpan={tokenColSpan}>
+                    {_.isUndefined(tokenLink) ? (
+                        this._renderTokenName(token)
+                    ) : (
+                        <a href={tokenLink} target="_blank" style={{ textDecoration: 'none' }}>
                             {this._renderTokenName(token)}
                         </a>
-                    }
+                    )}
                 </TableRowColumn>
-                <TableRowColumn style={{paddingRight: 3, paddingLeft: 3}}>
+                <TableRowColumn style={{ paddingRight: 3, paddingLeft: 3 }}>
                     {this._renderAmount(tokenState.balance, token.decimals)} {token.symbol}
-                    {this.state.isZRXSpinnerVisible && token.symbol === ZRX_TOKEN_SYMBOL &&
-                        <span className="pl1">
-                            <i className="zmdi zmdi-spinner zmdi-hc-spin" />
-                        </span>
-                    }
+                    {this.state.isZRXSpinnerVisible &&
+                        token.symbol === ZRX_TOKEN_SYMBOL && (
+                            <span className="pl1">
+                                <i className="zmdi zmdi-spinner zmdi-hc-spin" />
+                            </span>
+                        )}
                 </TableRowColumn>
                 <TableRowColumn>
                     <AllowanceToggle
@@ -412,29 +356,31 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                         userAddress={this.props.userAddress}
                     />
                 </TableRowColumn>
-                <TableRowColumn
-                    style={{paddingLeft: actionPaddingX, paddingRight: actionPaddingX}}
-                >
-                    {isMintable &&
+                <TableRowColumn style={{ paddingLeft: actionPaddingX, paddingRight: actionPaddingX }}>
+                    {isMintable && (
                         <LifeCycleRaisedButton
                             labelReady="Mint"
-                            labelLoading={<span style={{fontSize: 12}}>Minting...</span>}
+                            labelLoading={<span style={{ fontSize: 12 }}>Minting...</span>}
                             labelComplete="Minted!"
                             onClickAsyncFn={this._onMintTestTokensAsync.bind(this, token)}
                         />
-                    }
-                    {token.symbol === ZRX_TOKEN_SYMBOL && this.props.networkId === constants.NETWORK_ID_TESTNET &&
-                        <LifeCycleRaisedButton
-                            labelReady="Request"
-                            labelLoading="Sending..."
-                            labelComplete="Sent!"
-                            onClickAsyncFn={this._faucetRequestAsync.bind(this, false)}
-                        />
-                    }
+                    )}
+                    {token.symbol === ZRX_TOKEN_SYMBOL &&
+                        this.props.networkId === constants.NETWORK_ID_TESTNET && (
+                            <LifeCycleRaisedButton
+                                labelReady="Request"
+                                labelLoading="Sending..."
+                                labelComplete="Sent!"
+                                onClickAsyncFn={this._faucetRequestAsync.bind(this, false)}
+                            />
+                        )}
                 </TableRowColumn>
-                {this.props.screenWidth !== ScreenWidths.Sm &&
+                {this.props.screenWidth !== ScreenWidths.Sm && (
                     <TableRowColumn
-                        style={{paddingLeft: actionPaddingX, paddingRight: actionPaddingX}}
+                        style={{
+                            paddingLeft: actionPaddingX,
+                            paddingRight: actionPaddingX,
+                        }}
                     >
                         <SendButton
                             blockchain={this.props.blockchain}
@@ -444,7 +390,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                             onError={this._onSendFailed.bind(this)}
                         />
                     </TableRowColumn>
-                }
+                )}
             </TableRow>
         );
     }
@@ -491,11 +437,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         return (
             <div className="flex">
                 <TokenIcon token={token} diameter={ICON_DIMENSION} />
-                <div
-                    data-tip={true}
-                    data-for={tooltipId}
-                    className="mt2 ml2 sm-hide xs-hide"
-                >
+                <div data-tip={true} data-for={tooltipId} className="mt2 ml2 sm-hide xs-hide">
                     {token.name}
                 </div>
                 <ReactTooltip id={tooltipId}>{token.address}</ReactTooltip>
@@ -507,39 +449,31 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             case BalanceErrs.incorrectNetworkForFaucet:
                 return (
                     <div>
-                        Our faucet can only send test Ether to addresses on the {constants.TESTNET_NAME}
-                        {' '}testnet (networkId {constants.NETWORK_ID_TESTNET}). Please make sure you are
-                        {' '}connected to the {constants.TESTNET_NAME} testnet and try requesting ether again.
+                        Our faucet can only send test Ether to addresses on the {constants.TESTNET_NAME} testnet
+                        (networkId {constants.NETWORK_ID_TESTNET}). Please make sure you are connected to the{' '}
+                        {constants.TESTNET_NAME} testnet and try requesting ether again.
                     </div>
                 );
 
             case BalanceErrs.faucetRequestFailed:
                 return (
                     <div>
-                        An unexpected error occurred while trying to request test Ether from our faucet.
-                        {' '}Please refresh the page and try again.
+                        An unexpected error occurred while trying to request test Ether from our faucet. Please refresh
+                        the page and try again.
                     </div>
                 );
 
             case BalanceErrs.faucetQueueIsFull:
-                return (
-                    <div>
-                        Our test Ether faucet queue is full. Please try requesting test Ether again later.
-                    </div>
-                );
+                return <div>Our test Ether faucet queue is full. Please try requesting test Ether again later.</div>;
 
             case BalanceErrs.mintingFailed:
-                return (
-                    <div>
-                        Minting your test tokens failed unexpectedly. Please refresh the page and try again.
-                    </div>
-                );
+                return <div>Minting your test tokens failed unexpectedly. Please refresh the page and try again.</div>;
 
             case BalanceErrs.allowanceSettingFailed:
                 return (
                     <div>
-                        An unexpected error occurred while trying to set your test token allowance.
-                        {' '}Please refresh the page and try again.
+                        An unexpected error occurred while trying to set your test token allowance. Please refresh the
+                        page and try again.
                     </div>
                 );
 
@@ -553,9 +487,9 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
     private _renderDharmaLoanFrame() {
         if (utils.isUserOnMobile()) {
             return (
-                <h4 style={{textAlign: 'center'}}>
-                    We apologize -- Dharma loan requests are not available on
-                    mobile yet.  Please try again through your desktop browser.
+                <h4 style={{ textAlign: 'center' }}>
+                    We apologize -- Dharma loan requests are not available on mobile yet. Please try again through your
+                    desktop browser.
                 </h4>
             );
         } else {
@@ -619,9 +553,10 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
         const responseBody = await response.text();
         if (response.status !== constants.SUCCESS_STATUS) {
             utils.consoleLog(`Unexpected status code: ${response.status} -> ${responseBody}`);
-            const errorType = response.status === constants.UNAVAILABLE_STATUS ?
-                              BalanceErrs.faucetQueueIsFull :
-                              BalanceErrs.faucetRequestFailed;
+            const errorType =
+                response.status === constants.UNAVAILABLE_STATUS
+                    ? BalanceErrs.faucetQueueIsFull
+                    : BalanceErrs.faucetRequestFailed;
             this.setState({
                 errorType,
             });
-- 
cgit 


From 4dfa720f2dec2be0b0758633c087579a02e482bb Mon Sep 17 00:00:00 2001
From: Leonid Logvinov <logvinov.leon@gmail.com>
Date: Thu, 4 Jan 2018 12:38:19 +0100
Subject: Use configured version of bignumber in all packages

---
 packages/website/ts/components/token_balances.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 913eb8a78..112b3fe60 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -1,5 +1,5 @@
 import { ZeroEx } from '0x.js';
-import BigNumber from 'bignumber.js';
+import { BigNumber } from '@0xproject/utils';
 import DharmaLoanFrame from 'dharma-loan-frame';
 import * as _ from 'lodash';
 import Dialog from 'material-ui/Dialog';
-- 
cgit 


From b4375d6f64fc0651c7ba347fcfe36e171fa261fc Mon Sep 17 00:00:00 2001
From: Leonid Logvinov <logvinov.leon@gmail.com>
Date: Wed, 17 Jan 2018 16:14:25 +0100
Subject: Enable restrict-plus-operands and fix issues detected

---
 packages/website/ts/components/token_balances.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 112b3fe60..5e7b4e9f6 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -514,7 +514,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
             this.props.dispatcher.showFlashMessage(`Successfully minted ${amount.toString(10)} ${token.symbol}`);
             return true;
         } catch (err) {
-            const errMsg = '' + err;
+            const errMsg = `${err}`;
             if (_.includes(errMsg, BlockchainCallErrs.UserHasNoAssociatedAddresses)) {
                 this.props.dispatcher.updateShouldBlockchainErrDialogBeOpen(true);
                 return false;
-- 
cgit 


From eb0d7df50b23af325edaecd7a7cccb269d7c8f88 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Thu, 18 Jan 2018 14:27:12 +0800
Subject: Fix balance page copy to refer to the Wrap ETH tab instead of a
 "convert" button

---
 packages/website/ts/components/token_balances.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx
index 112b3fe60..01e69d4b2 100644
--- a/packages/website/ts/components/token_balances.tsx
+++ b/packages/website/ts/components/token_balances.tsx
@@ -169,7 +169,7 @@ export class TokenBalances extends React.Component<TokenBalancesProps, TokenBala
                         ? 'In order to try out the 0x Portal Dapp, request some test ether to pay for \
                         gas costs. It might take a bit of time for the test ether to show up.'
                         : 'Ether must be converted to Ether Tokens in order to be tradable via 0x. \
-                         You can convert between Ether and Ether Tokens by clicking the "convert" button below.'}
+                         You can convert between Ether and Ether Tokens from the "Wrap ETH" tab.'}
                 </div>
                 <Table selectable={false} style={styles.bgColor}>
                     <TableHeader displaySelectAll={false} adjustForCheckbox={false}>
-- 
cgit 

