From 518efa8ad2765b3664ad1b5433c56a82cc7c50be Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Tue, 6 Feb 2018 17:29:10 -0800 Subject: Move isTestNetwork into utils and also check it from showing ZRX request button --- packages/website/ts/components/token_balances.tsx | 11 ++--------- packages/website/ts/utils/utils.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/packages/website/ts/components/token_balances.tsx b/packages/website/ts/components/token_balances.tsx index d91dbd093..301a332ce 100644 --- a/packages/website/ts/components/token_balances.tsx +++ b/packages/website/ts/components/token_balances.tsx @@ -176,14 +176,7 @@ export class TokenBalances extends React.Component, ]; - const isTestNetwork = _.includes( - [ - constants.NETWORK_ID_BY_NAME[Networks.Kovan], - constants.NETWORK_ID_BY_NAME[Networks.Rinkeby], - constants.NETWORK_ID_BY_NAME[Networks.Ropsten], - ], - this.props.networkId, - ); + const isTestNetwork = utils.isTestNetwork(this.props.networkId); const isKovanTestNetwork = this.props.networkId === constants.NETWORK_ID_KOVAN; const dharmaButtonColumnStyle = { paddingLeft: 3, @@ -426,7 +419,7 @@ export class TokenBalances extends React.Component )} {token.symbol === ZRX_TOKEN_SYMBOL && - this.props.networkId === constants.NETWORK_ID_KOVAN && ( + utils.isTestNetwork(this.props.networkId) && (