From 85020c74cf8622d131b21f82a8027d437717712e Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Fri, 18 May 2018 11:33:46 -0700 Subject: Fix prettier --- .../ts/components/inputs/balance_bounded_input.tsx | 33 +++++++++++----------- .../ts/components/wallet/wrap_ether_item.tsx | 6 +--- 2 files changed, 17 insertions(+), 22 deletions(-) (limited to 'packages/website/ts/components') diff --git a/packages/website/ts/components/inputs/balance_bounded_input.tsx b/packages/website/ts/components/inputs/balance_bounded_input.tsx index f91a99355..e5b502b25 100644 --- a/packages/website/ts/components/inputs/balance_bounded_input.tsx +++ b/packages/website/ts/components/inputs/balance_bounded_input.tsx @@ -105,19 +105,15 @@ export class BalanceBoundedInput extends React.Component { - const isValid = _.isUndefined(this._validate(amountString, this.props.balance)); - const isPositiveNumber = utils.isNumeric(amountString) && !_.includes(amountString, '-'); - if (isPositiveNumber) { - this.props.onChange(isValid, new BigNumber(amountString)); - } else { - this.props.onChange(isValid); - } - }, - ); + this._setAmountState(amountString, this.props.balance, () => { + const isValid = _.isUndefined(this._validate(amountString, this.props.balance)); + const isPositiveNumber = utils.isNumeric(amountString) && !_.includes(amountString, '-'); + if (isPositiveNumber) { + this.props.onChange(isValid, new BigNumber(amountString)); + } else { + this.props.onChange(isValid); + } + }); } private _validate(amountString: string, balance: BigNumber): React.ReactNode { if (!utils.isNumeric(amountString)) { @@ -163,9 +159,12 @@ export class BalanceBoundedInput extends React.Component void = _.noop): void { const errorMsg = this._validate(amount, balance); this.props.onErrorMsgChange(errorMsg); - this.setState({ - amountString: amount, - errMsg: errorMsg, - }, callback); + this.setState( + { + amountString: amount, + errMsg: errorMsg, + }, + callback, + ); } } diff --git a/packages/website/ts/components/wallet/wrap_ether_item.tsx b/packages/website/ts/components/wallet/wrap_ether_item.tsx index 581d2ba97..db0983407 100644 --- a/packages/website/ts/components/wallet/wrap_ether_item.tsx +++ b/packages/website/ts/components/wallet/wrap_ether_item.tsx @@ -172,11 +172,7 @@ export class WrapEtherItem extends React.Component - {this.state.errorMsg} - - ); + return
{this.state.errorMsg}
; } private async _wrapEtherConfirmationActionAsync(): Promise { this.setState({ -- cgit