diff options
author | Fabio Berger <me@fabioberger.com> | 2017-12-19 02:30:25 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-12-19 02:30:25 +0800 |
commit | fb0b7efc4563c7c561866ab8691361ce6919160b (patch) | |
tree | dbbf76c091be331f8a44ed5b7569c7c4742f6fa3 /packages/website/ts/components/eth_wrappers.tsx | |
parent | 400228e139a5c74302f1a16b8ca5c43ea4843307 (diff) | |
download | dexon-sol-tools-fb0b7efc4563c7c561866ab8691361ce6919160b.tar.gz dexon-sol-tools-fb0b7efc4563c7c561866ab8691361ce6919160b.tar.zst dexon-sol-tools-fb0b7efc4563c7c561866ab8691361ce6919160b.zip |
Refactor configs and constants, standardize on uppercase/snakecase, alphebetize, rename for logical grouping
Diffstat (limited to 'packages/website/ts/components/eth_wrappers.tsx')
-rw-r--r-- | packages/website/ts/components/eth_wrappers.tsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/website/ts/components/eth_wrappers.tsx b/packages/website/ts/components/eth_wrappers.tsx index ef1379e59..59353d18c 100644 --- a/packages/website/ts/components/eth_wrappers.tsx +++ b/packages/website/ts/components/eth_wrappers.tsx @@ -82,7 +82,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt const tokens = _.values(this.props.tokenByAddress); const etherToken = _.find(tokens, {symbol: 'WETH'}); const etherTokenState = this.props.tokenStateByAddress[etherToken.address]; - const wethBalance = ZeroEx.toUnitAmount(etherTokenState.balance, 18); + const wethBalance = ZeroEx.toUnitAmount(etherTokenState.balance, constants.DECIMAL_PLACES_ETH); const isBidirectional = true; return ( <div className="clearfix lg-px4 md-px4 sm-px2" style={{minHeight: 600}}> @@ -155,7 +155,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt <div className="flex"> <img style={{width: ICON_DIMENSION, height: ICON_DIMENSION}} - src={constants.iconUrlBySymbol.WETH} + src={configs.ICON_URL_BY_SYMBOL.WETH} /> <div className="mt2 ml2 sm-hide xs-hide"> Wrapped Ether @@ -241,7 +241,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt ); } private renderOutdatedWeths(etherToken: Token, etherTokenState: TokenState) { - const rows = _.map(configs.outdatedWrappedEthers, + const rows = _.map(configs.OUTDATED_WRAPPED_ETHERS, (outdatedWETHByNetworkId: OutdatedWrappedEtherByNetworkId) => { const outdatedWETH = outdatedWETHByNetworkId[this.props.networkId]; const timestampMsRange = outdatedWETH.timestampMsRange; @@ -260,7 +260,9 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt const isStateLoaded = this.state.outdatedWETHAddressToIsStateLoaded[outdatedWETH.address]; const outdatedEtherTokenState = this.state.outdatedWETHStateByAddress[outdatedWETH.address]; const balanceInEthIfExists = isStateLoaded ? - ZeroEx.toUnitAmount(outdatedEtherTokenState.balance, 18).toFixed(PRECISION) : + ZeroEx.toUnitAmount( + outdatedEtherTokenState.balance, constants.DECIMAL_PLACES_ETH, + ).toFixed(PRECISION) : undefined; const onConversionSuccessful = this.onOutdatedConversionSuccessfulAsync.bind(this, outdatedWETH.address); return ( @@ -344,7 +346,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt }); } private getOutdatedWETHAddresses(): string[] { - const outdatedWETHAddresses = _.map(configs.outdatedWrappedEthers, outdatedWrappedEther => { + const outdatedWETHAddresses = _.map(configs.OUTDATED_WRAPPED_ETHERS, outdatedWrappedEther => { return outdatedWrappedEther[this.props.networkId].address; }); return outdatedWETHAddresses; |