diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-16 22:18:47 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-16 22:18:47 +0800 |
commit | 78623ae3bdba39b629a22aa2d15d8aee5e6225ab (patch) | |
tree | f44871dc1b081669c83cf041cebe559ecb57bace /packages/website/ts/components/eth_wrappers.tsx | |
parent | 136c6d01b3f01e6db8aab01c4b4b7315abadba24 (diff) | |
parent | 4de6221825447e77d7b1ee6bab28ce3407939301 (diff) | |
download | dexon-0x-contracts-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar.gz dexon-0x-contracts-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.tar.zst dexon-0x-contracts-78623ae3bdba39b629a22aa2d15d8aee5e6225ab.zip |
Merge branch 'development' into v2-prototype
* development: (29 commits)
Do not remove artifacts when running `clean`
fix style errors
Fix circular dependency
Add my profile image to images
Add myself to about page
Add dogfood configs to website
Revert to lerna:run lint
Do lint sequentially
Exclude monorepo-scripts from tslint as test
Fix prettier
Add hover state to top tokens
Change to weekly txn volume
Change minimum Node version to 6.12
Document Node.js version requirement and add it to package.json
Apply prettier to some files which were not formatted correctly
Fix TSLint issues
Fix TSLint issues
Update ethereeumjs-testrpc to ganache-cli
Fix infinite loop
Add changelog entries for packages where executable binary exporting fixed
...
# Conflicts:
# packages/contracts/package.json
# packages/contracts/util/formatters.ts
# packages/contracts/util/signed_order_utils.ts
# packages/migrations/package.json
# yarn.lock
Diffstat (limited to 'packages/website/ts/components/eth_wrappers.tsx')
-rw-r--r-- | packages/website/ts/components/eth_wrappers.tsx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/packages/website/ts/components/eth_wrappers.tsx b/packages/website/ts/components/eth_wrappers.tsx index 59afeb50b..f19b05861 100644 --- a/packages/website/ts/components/eth_wrappers.tsx +++ b/packages/website/ts/components/eth_wrappers.tsx @@ -65,7 +65,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt }, }; } - public componentWillReceiveProps(nextProps: EthWrappersProps) { + public componentWillReceiveProps(nextProps: EthWrappersProps): void { if ( nextProps.userAddress !== this.props.userAddress || nextProps.networkId !== this.props.networkId || @@ -75,15 +75,15 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt this._fetchWETHStateAsync(); } } - public componentDidMount() { + public componentDidMount(): void { window.scrollTo(0, 0); // tslint:disable-next-line:no-floating-promises this._fetchWETHStateAsync(); } - public componentWillUnmount() { + public componentWillUnmount(): void { this._isUnmounted = true; } - public render() { + public render(): React.ReactNode { const etherToken = this._getEthToken(); const wethBalance = ZeroEx.toUnitAmount(this.state.ethTokenState.balance, constants.DECIMAL_PLACES_ETH); const isBidirectional = true; @@ -222,7 +222,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt </div> ); } - private _renderActionColumnTitle(isBidirectional: boolean) { + private _renderActionColumnTitle(isBidirectional: boolean): React.ReactNode { let iconClass = 'zmdi-long-arrow-right'; let leftSymbol = 'WETH'; let rightSymbol = 'ETH'; @@ -241,7 +241,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt </div> ); } - private _renderOutdatedWeths(etherToken: Token, etherTokenState: TokenState) { + private _renderOutdatedWeths(etherToken: Token, etherTokenState: TokenState): React.ReactNode { const rows = _.map( configs.OUTDATED_WRAPPED_ETHERS, (outdatedWETHByNetworkId: OutdatedWrappedEtherByNetworkId) => { @@ -313,7 +313,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt ); return rows; } - private _renderTokenLink(tokenLabel: React.ReactNode, etherscanUrl: string) { + private _renderTokenLink(tokenLabel: React.ReactNode, etherscanUrl: string): React.ReactNode { return ( <span> {_.isUndefined(etherscanUrl) ? ( @@ -326,7 +326,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt </span> ); } - private _renderToken(name: string, address: string, imgPath: string) { + private _renderToken(name: string, address: string, imgPath: string): React.ReactNode { const tooltipId = `tooltip-${address}`; return ( <div className="flex"> @@ -340,7 +340,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt </div> ); } - private async _onOutdatedConversionSuccessfulAsync(outdatedWETHAddress: string) { + private async _onOutdatedConversionSuccessfulAsync(outdatedWETHAddress: string): Promise<void> { const currentOutdatedWETHState = this.state.outdatedWETHStateByAddress[outdatedWETHAddress]; this.setState({ outdatedWETHStateByAddress: { @@ -368,7 +368,7 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt }, }); } - private async _fetchWETHStateAsync() { + private async _fetchWETHStateAsync(): Promise<void> { const tokens = _.values(this.props.tokenByAddress); const wethToken = _.find(tokens, token => token.symbol === 'WETH'); const userAddressIfExists = _.isEmpty(this.props.userAddress) ? undefined : this.props.userAddress; @@ -414,12 +414,12 @@ export class EthWrappers extends React.Component<EthWrappersProps, EthWrappersSt ); return outdatedWETHAddresses; } - private _getEthToken() { + private _getEthToken(): Token { const tokens = _.values(this.props.tokenByAddress); const etherToken = _.find(tokens, { symbol: 'WETH' }); return etherToken; } - private async _refetchEthTokenStateAsync() { + private async _refetchEthTokenStateAsync(): Promise<void> { const etherToken = this._getEthToken(); const userAddressIfExists = _.isEmpty(this.props.userAddress) ? undefined : this.props.userAddress; const [balance, allowance] = await this.props.blockchain.getTokenBalanceAndAllowanceAsync( |