aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-05-19 02:33:46 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-05-19 02:33:46 +0800
commit85020c74cf8622d131b21f82a8027d437717712e (patch)
tree450cd1dc85f960c2c469d802c2a21f764c738660 /packages/website/ts
parent0137c0da8ccd48fdae2a2685216a9f2e828b2753 (diff)
downloaddexon-sol-tools-85020c74cf8622d131b21f82a8027d437717712e.tar
dexon-sol-tools-85020c74cf8622d131b21f82a8027d437717712e.tar.gz
dexon-sol-tools-85020c74cf8622d131b21f82a8027d437717712e.tar.bz2
dexon-sol-tools-85020c74cf8622d131b21f82a8027d437717712e.tar.lz
dexon-sol-tools-85020c74cf8622d131b21f82a8027d437717712e.tar.xz
dexon-sol-tools-85020c74cf8622d131b21f82a8027d437717712e.tar.zst
dexon-sol-tools-85020c74cf8622d131b21f82a8027d437717712e.zip
Fix prettier
Diffstat (limited to 'packages/website/ts')
-rw-r--r--packages/website/ts/components/inputs/balance_bounded_input.tsx33
-rw-r--r--packages/website/ts/components/wallet/wrap_ether_item.tsx6
2 files changed, 17 insertions, 22 deletions
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<BalanceBoundedInputProp
);
}
private _onValueChange(e: any, amountString: string): void {
- 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);
- }
- },
- );
+ 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<BalanceBoundedInputProp
private _setAmountState(amount: string, balance: BigNumber, callback: () => 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<WrapEtherItemProps, WrapEther
);
}
private _renderErrorMsg(): React.ReactNode {
- return (
- <div style={styles.errorMsg}>
- {this.state.errorMsg}
- </div>
- );
+ return <div style={styles.errorMsg}>{this.state.errorMsg}</div>;
}
private async _wrapEtherConfirmationActionAsync(): Promise<void> {
this.setState({