diff options
author | Fabio Berger <me@fabioberger.com> | 2018-05-14 17:30:51 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-05-14 17:30:51 +0800 |
commit | c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6 (patch) | |
tree | 986b220cf80aab8d8e8ef6c4cef8c08be6eeab10 /packages/website/ts/components/fill_order.tsx | |
parent | 7d60356facce60c1d4d80c703bfc565c5c47e73b (diff) | |
parent | 58fa35641d3016ef106496c929e48febcf827dc6 (diff) | |
download | dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.gz dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.bz2 dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.lz dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.xz dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.tar.zst dexon-sol-tools-c94d1b22754c1d1bf10f0dd2b9c13eea91e17cb6.zip |
Merge branch 'development' of github.com:0xProject/0x-monorepo into development
* 'development' of github.com:0xProject/0x-monorepo:
Add missing type definitions
Diffstat (limited to 'packages/website/ts/components/fill_order.tsx')
-rw-r--r-- | packages/website/ts/components/fill_order.tsx | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/packages/website/ts/components/fill_order.tsx b/packages/website/ts/components/fill_order.tsx index ea94e0987..59c32cebc 100644 --- a/packages/website/ts/components/fill_order.tsx +++ b/packages/website/ts/components/fill_order.tsx @@ -82,19 +82,19 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { tokensToTrack: [], }; } - public componentWillMount() { + public componentWillMount(): void { if (!_.isEmpty(this.state.orderJSON)) { // tslint:disable-next-line:no-floating-promises this._validateFillOrderFireAndForgetAsync(this.state.orderJSON); } } - public componentDidMount() { + public componentDidMount(): void { window.scrollTo(0, 0); } - public componentWillUnmount() { + public componentWillUnmount(): void { this._isUnmounted = true; } - public render() { + public render(): React.ReactNode { return ( <div className="clearfix lg-px4 md-px4 sm-px2" style={{ minHeight: 600 }}> <h3>Fill an order</h3> @@ -159,7 +159,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { </div> ); } - private _renderOrderJsonNotices() { + private _renderOrderJsonNotices(): React.ReactNode { return ( <div> {!_.isUndefined(this.props.initialOrder) && @@ -177,7 +177,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { </div> ); } - private _renderVisualOrder() { + private _renderVisualOrder(): React.ReactNode { const takerTokenAddress = this.state.parsedOrder.signedOrder.takerTokenAddress; const takerToken = this.props.tokenByAddress[takerTokenAddress]; const orderTakerAmount = new BigNumber(this.state.parsedOrder.signedOrder.takerTokenAmount); @@ -306,7 +306,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { </div> ); } - private _renderFillSuccessMsg() { + private _renderFillSuccessMsg(): React.ReactNode { return ( <div> Order successfully filled. See the trade details in your{' '} @@ -316,10 +316,10 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { </div> ); } - private _renderCancelSuccessMsg() { + private _renderCancelSuccessMsg(): React.ReactNode { return <div>Order successfully cancelled.</div>; } - private _onFillOrderClick() { + private _onFillOrderClick(): void { if (!this.state.isMakerTokenAddressInRegistry || !this.state.isTakerTokenAddressInRegistry) { this.setState({ isFillWarningDialogOpen: true, @@ -329,7 +329,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { this._onFillOrderClickFireAndForgetAsync(); } } - private _onFillWarningClosed(didUserCancel: boolean) { + private _onFillWarningClosed(didUserCancel: boolean): void { this.setState({ isFillWarningDialogOpen: false, }); @@ -338,10 +338,10 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { this._onFillOrderClickFireAndForgetAsync(); } } - private _onFillAmountChange(isValid: boolean, amount?: BigNumber) { + private _onFillAmountChange(isValid: boolean, amount?: BigNumber): void { this.props.dispatcher.updateOrderFillAmount(amount); } - private _onFillOrderJSONChanged(event: any) { + private _onFillOrderJSONChanged(event: any): void { const orderJSON = event.target.value; this.setState({ didOrderValidationRun: _.isEmpty(orderJSON) && _.isEmpty(this.state.orderJSONErrMsg), @@ -350,7 +350,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { // tslint:disable-next-line:no-floating-promises this._validateFillOrderFireAndForgetAsync(orderJSON); } - private async _checkForUntrackedTokensAndAskToAdd() { + private async _checkForUntrackedTokensAndAskToAddAsync(): Promise<void> { if (!_.isEmpty(this.state.orderJSONErrMsg)) { return; } @@ -396,7 +396,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { }); } } - private async _validateFillOrderFireAndForgetAsync(orderJSON: string) { + private async _validateFillOrderFireAndForgetAsync(orderJSON: string): Promise<void> { let orderJSONErrMsg = ''; let parsedOrder: Order; let orderHash: string; @@ -491,7 +491,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { unavailableTakerAmount, }); - await this._checkForUntrackedTokensAndAskToAdd(); + await this._checkForUntrackedTokensAndAskToAddAsync(); } private async _onFillOrderClickFireAndForgetAsync(): Promise<void> { if (this.props.blockchainErr !== BlockchainErrs.NoError || _.isEmpty(this.props.userAddress)) { @@ -650,7 +650,7 @@ export class FillOrder extends React.Component<FillOrderProps, FillOrderState> { const roundedUnitAmount = Math.round(unitAmount.toNumber() * 100000) / 100000; return roundedUnitAmount; } - private _onToggleTrackConfirmDialog(didConfirmTokenTracking: boolean) { + private _onToggleTrackConfirmDialog(didConfirmTokenTracking: boolean): void { if (!didConfirmTokenTracking) { this.setState({ orderJSON: '', |