diff options
author | Fabio Berger <me@fabioberger.com> | 2018-03-10 02:02:07 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-03-10 02:02:07 +0800 |
commit | 7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285 (patch) | |
tree | f943b6a3aabfea45eadc222e9bbfc3a2ce2906e9 /packages/website/ts/components/eth_wrappers.tsx | |
parent | 8f921a61da6b9976ea680df4fd51147bb78040d9 (diff) | |
download | dexon-0x-contracts-7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285.tar dexon-0x-contracts-7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285.tar.gz dexon-0x-contracts-7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285.tar.bz2 dexon-0x-contracts-7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285.tar.lz dexon-0x-contracts-7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285.tar.xz dexon-0x-contracts-7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285.tar.zst dexon-0x-contracts-7ebebb5bd9e0b60aab8dfac22bc1663d3fc13285.zip |
Create blockchainWatcher class and refactor Portal such that Ether amounts are always passed around as baseUnits
Diffstat (limited to 'packages/website/ts/components/eth_wrappers.tsx')
-rw-r--r-- | packages/website/ts/components/eth_wrappers.tsx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/website/ts/components/eth_wrappers.tsx b/packages/website/ts/components/eth_wrappers.tsx index 7ac5d5c9c..8aac31917 100644 --- a/packages/website/ts/components/eth_wrappers.tsx +++ b/packages/website/ts/components/eth_wrappers.tsx @@ -34,7 +34,7 @@ interface EthWrappersProps { dispatcher: Dispatcher; tokenByAddress: TokenByAddress; userAddress: string; - userEtherBalance: BigNumber; + userEtherBalanceInWei: BigNumber; lastForceTokenStateRefetch: number; } @@ -98,6 +98,10 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt EtherscanLinkSuffixes.Address, ); const tokenLabel = this._renderToken('Wrapped Ether', etherToken.address, configs.ICON_URL_BY_SYMBOL.WETH); + const userEtherBalanceInEth = ZeroEx.toUnitAmount( + this.props.userEtherBalanceInWei, + constants.DECIMAL_PLACES_ETH, + ); return ( <div className="clearfix lg-px4 md-px4 sm-px2" style={{ minHeight: 600 }}> <div className="relative"> @@ -143,9 +147,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt </div> </div> </TableRowColumn> - <TableRowColumn> - {this.props.userEtherBalance.toFixed(PRECISION)} ETH - </TableRowColumn> + <TableRowColumn>{userEtherBalanceInEth.toFixed(PRECISION)} ETH</TableRowColumn> <TableRowColumn> <EthWethConversionButton refetchEthTokenStateAsync={this._refetchEthTokenStateAsync.bind(this)} @@ -157,7 +159,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt ethToken={etherToken} dispatcher={this.props.dispatcher} blockchain={this.props.blockchain} - userEtherBalance={this.props.userEtherBalance} + userEtherBalanceInWei={this.props.userEtherBalanceInWei} /> </TableRowColumn> </TableRow> @@ -184,7 +186,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt ethToken={etherToken} dispatcher={this.props.dispatcher} blockchain={this.props.blockchain} - userEtherBalance={this.props.userEtherBalance} + userEtherBalanceInWei={this.props.userEtherBalanceInWei} /> </TableRowColumn> </TableRow> @@ -304,7 +306,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt ethToken={outdatedEtherToken} dispatcher={this.props.dispatcher} blockchain={this.props.blockchain} - userEtherBalance={this.props.userEtherBalance} + userEtherBalanceInWei={this.props.userEtherBalanceInWei} onConversionSuccessful={onConversionSuccessful} /> </TableRowColumn> |