From e744e4cd989bd3ae1070c59f7baa8097f18b8b06 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 22 Dec 2017 15:05:32 +0100 Subject: Apply prettier config --- .../ts/components/generate_order/asset_picker.tsx | 76 +++++++++--------- .../generate_order/generate_order_form.tsx | 92 +++++++++++++--------- .../components/generate_order/new_token_form.tsx | 47 +++++------ 3 files changed, 117 insertions(+), 98 deletions(-) (limited to 'packages/website/ts/components/generate_order') diff --git a/packages/website/ts/components/generate_order/asset_picker.tsx b/packages/website/ts/components/generate_order/asset_picker.tsx index 407070607..df7d87cfd 100644 --- a/packages/website/ts/components/generate_order/asset_picker.tsx +++ b/packages/website/ts/components/generate_order/asset_picker.tsx @@ -2,19 +2,13 @@ import * as _ from 'lodash'; import Dialog from 'material-ui/Dialog'; import FlatButton from 'material-ui/FlatButton'; import * as React from 'react'; -import {Blockchain} from 'ts/blockchain'; -import {NewTokenForm} from 'ts/components/generate_order/new_token_form'; -import {TrackTokenConfirmation} from 'ts/components/track_token_confirmation'; -import {TokenIcon} from 'ts/components/ui/token_icon'; -import {trackedTokenStorage} from 'ts/local_storage/tracked_token_storage'; -import {Dispatcher} from 'ts/redux/dispatcher'; -import { - DialogConfigs, - Token, - TokenByAddress, - TokenState, - TokenVisibility, -} from 'ts/types'; +import { Blockchain } from 'ts/blockchain'; +import { NewTokenForm } from 'ts/components/generate_order/new_token_form'; +import { TrackTokenConfirmation } from 'ts/components/track_token_confirmation'; +import { TokenIcon } from 'ts/components/ui/token_icon'; +import { trackedTokenStorage } from 'ts/local_storage/tracked_token_storage'; +import { Dispatcher } from 'ts/redux/dispatcher'; +import { DialogConfigs, Token, TokenByAddress, TokenState, TokenVisibility } from 'ts/types'; const TOKEN_ICON_DIMENSION = 100; const TILE_DIMENSION = 146; @@ -47,7 +41,7 @@ export class AssetPicker extends React.Component = { tokenVisibility: TokenVisibility.ALL, }; - private _dialogConfigsByAssetView: {[assetView: string]: DialogConfigs}; + private _dialogConfigsByAssetView: { [assetView: string]: DialogConfigs }; constructor(props: AssetPickerProps) { super(props); this.state = { @@ -90,25 +84,21 @@ export class AssetPicker extends React.Component - {this.state.assetView === AssetViews.ASSET_PICKER && - this._renderAssetPicker() - } - {this.state.assetView === AssetViews.NEW_TOKEN_FORM && + {this.state.assetView === AssetViews.ASSET_PICKER && this._renderAssetPicker()} + {this.state.assetView === AssetViews.NEW_TOKEN_FORM && ( - } - {this.state.assetView === AssetViews.CONFIRM_TRACK_TOKEN && - this._renderConfirmTrackToken() - } + )} + {this.state.assetView === AssetViews.CONFIRM_TRACK_TOKEN && this._renderConfirmTrackToken()} ); } @@ -127,7 +117,12 @@ export class AssetPicker extends React.Component {this._renderGridTiles()} @@ -137,8 +132,10 @@ export class AssetPicker extends React.Component { - if ((this.props.tokenVisibility === TokenVisibility.TRACKED && !token.isTracked) || - (this.props.tokenVisibility === TokenVisibility.UNTRACKED && token.isTracked)) { + if ( + (this.props.tokenVisibility === TokenVisibility.TRACKED && !token.isTracked) || + (this.props.tokenVisibility === TokenVisibility.UNTRACKED && token.isTracked) + ) { return null; // Skip } isHovered = this.state.hoveredAddress === address; @@ -149,7 +146,11 @@ export class AssetPicker extends React.Component
Other ERC20 Token
- - )); + , + ); } return gridTiles; } @@ -251,10 +256,9 @@ export class AssetPicker extends React.Component \ allowed to fill this order. If no taker is
\ specified, anyone is able to fill it.'; const exchangeContractIfExists = this.props.blockchain.getExchangeContractAddressIfExists(); @@ -92,7 +93,7 @@ export class GenerateOrderForm extends React.Component

Generate an order

-
+
@@ -121,9 +122,7 @@ export class GenerateOrderForm extends React.Component
- +
@@ -154,7 +153,7 @@ export class GenerateOrderForm extends React.Component
-
Expiration
+
Expiration
- +
@@ -192,14 +189,14 @@ export class GenerateOrderForm extends React.Component
- {this.state.globalErrMsg !== '' && + {this.state.globalErrMsg !== '' && ( - } + )}
0) { globalErrMsg = 'Order signing failed. Please refresh and try again'; diff --git a/packages/website/ts/components/generate_order/new_token_form.tsx b/packages/website/ts/components/generate_order/new_token_form.tsx index fe40854cb..d0cd6add1 100644 --- a/packages/website/ts/components/generate_order/new_token_form.tsx +++ b/packages/website/ts/components/generate_order/new_token_form.tsx @@ -2,13 +2,13 @@ import BigNumber from 'bignumber.js'; import * as _ from 'lodash'; import TextField from 'material-ui/TextField'; import * as React from 'react'; -import {Blockchain} from 'ts/blockchain'; -import {AddressInput} from 'ts/components/inputs/address_input'; -import {Alert} from 'ts/components/ui/alert'; -import {LifeCycleRaisedButton} from 'ts/components/ui/lifecycle_raised_button'; -import {RequiredLabel} from 'ts/components/ui/required_label'; -import {AlertTypes, Token, TokenByAddress, TokenState} from 'ts/types'; -import {colors} from 'ts/utils/colors'; +import { Blockchain } from 'ts/blockchain'; +import { AddressInput } from 'ts/components/inputs/address_input'; +import { Alert } from 'ts/components/ui/alert'; +import { LifeCycleRaisedButton } from 'ts/components/ui/lifecycle_raised_button'; +import { RequiredLabel } from 'ts/components/ui/required_label'; +import { AlertTypes, Token, TokenByAddress, TokenState } from 'ts/types'; +import { colors } from 'ts/utils/colors'; interface NewTokenFormProps { blockchain: Blockchain; @@ -45,11 +45,11 @@ export class NewTokenForm extends React.Component +
} value={this.state.name} errorText={this.state.nameErrText} @@ -59,7 +59,7 @@ export class NewTokenForm extends React.Component } value={this.state.symbol} errorText={this.state.symbolErrText} @@ -78,14 +78,14 @@ export class NewTokenForm extends React.Component } value={this.state.decimals} errorText={this.state.decimalsErrText} onChange={this._onTokenDecimalsChanged.bind(this)} />
-
+
- {this.state.globalErrMsg !== '' && - - } + {this.state.globalErrMsg !== '' && }
); } @@ -116,18 +114,21 @@ export class NewTokenForm extends React.Component