diff options
author | Fabio Berger <me@fabioberger.com> | 2017-11-28 12:08:08 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2017-11-28 12:08:08 +0800 |
commit | 5a59ac4c6b9068fa55168bb072ee782cf3c7cd91 (patch) | |
tree | 89f29601440e401dace6a4ab9886fa608aa1bf20 /packages/website/ts/components/ui | |
parent | 0a19ba3014ac68c1c94fcb376bc1ddb5081db757 (diff) | |
download | dexon-sol-tools-5a59ac4c6b9068fa55168bb072ee782cf3c7cd91.tar dexon-sol-tools-5a59ac4c6b9068fa55168bb072ee782cf3c7cd91.tar.gz dexon-sol-tools-5a59ac4c6b9068fa55168bb072ee782cf3c7cd91.tar.bz2 dexon-sol-tools-5a59ac4c6b9068fa55168bb072ee782cf3c7cd91.tar.lz dexon-sol-tools-5a59ac4c6b9068fa55168bb072ee782cf3c7cd91.tar.xz dexon-sol-tools-5a59ac4c6b9068fa55168bb072ee782cf3c7cd91.tar.zst dexon-sol-tools-5a59ac4c6b9068fa55168bb072ee782cf3c7cd91.zip |
fix remaining tslint errors
Diffstat (limited to 'packages/website/ts/components/ui')
19 files changed, 34 insertions, 37 deletions
diff --git a/packages/website/ts/components/ui/alert.tsx b/packages/website/ts/components/ui/alert.tsx index bf2f0baf5..71d2388f2 100644 --- a/packages/website/ts/components/ui/alert.tsx +++ b/packages/website/ts/components/ui/alert.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import {colors} from 'material-ui/styles'; +import * as React from 'react'; import {AlertTypes} from 'ts/types'; const CUSTOM_GREEN = 'rgb(137, 199, 116)'; diff --git a/packages/website/ts/components/ui/badge.tsx b/packages/website/ts/components/ui/badge.tsx index 1e3bbdb99..15d5ea227 100644 --- a/packages/website/ts/components/ui/badge.tsx +++ b/packages/website/ts/components/ui/badge.tsx @@ -1,6 +1,6 @@ import * as _ from 'lodash'; -import * as React from 'react'; import {colors} from 'material-ui/styles'; +import * as React from 'react'; import {Styles} from 'ts/types'; const styles: Styles = { diff --git a/packages/website/ts/components/ui/copy_icon.tsx b/packages/website/ts/components/ui/copy_icon.tsx index f8abaa59e..5f8e6a060 100644 --- a/packages/website/ts/components/ui/copy_icon.tsx +++ b/packages/website/ts/components/ui/copy_icon.tsx @@ -1,8 +1,8 @@ import * as _ from 'lodash'; +import {colors} from 'material-ui/styles'; import * as React from 'react'; -import * as ReactDOM from 'react-dom'; import * as CopyToClipboard from 'react-copy-to-clipboard'; -import {colors} from 'material-ui/styles'; +import * as ReactDOM from 'react-dom'; import ReactTooltip = require('react-tooltip'); interface CopyIconProps { diff --git a/packages/website/ts/components/ui/drop_down_menu_item.tsx b/packages/website/ts/components/ui/drop_down_menu_item.tsx index b8b7eb167..05b88f7ce 100644 --- a/packages/website/ts/components/ui/drop_down_menu_item.tsx +++ b/packages/website/ts/components/ui/drop_down_menu_item.tsx @@ -1,12 +1,12 @@ import * as _ from 'lodash'; +import Menu from 'material-ui/Menu'; +import MenuItem from 'material-ui/MenuItem'; +import Popover from 'material-ui/Popover'; import * as React from 'react'; +import {Link} from 'react-router-dom'; import { Link as ScrollLink, } from 'react-scroll'; -import {Link} from 'react-router-dom'; -import Popover from 'material-ui/Popover'; -import Menu from 'material-ui/Menu'; -import MenuItem from 'material-ui/MenuItem'; import {Styles, WebsitePaths} from 'ts/types'; const CHECK_CLOSE_POPOVER_INTERVAL_MS = 300; diff --git a/packages/website/ts/components/ui/ethereum_address.tsx b/packages/website/ts/components/ui/ethereum_address.tsx index c3d03b78c..b3bc0bc59 100644 --- a/packages/website/ts/components/ui/ethereum_address.tsx +++ b/packages/website/ts/components/ui/ethereum_address.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import {EtherScanIcon} from 'ts/components/ui/etherscan_icon'; import ReactTooltip = require('react-tooltip'); +import {EtherScanIcon} from 'ts/components/ui/etherscan_icon'; import {EtherscanLinkSuffixes} from 'ts/types'; import {utils} from 'ts/utils/utils'; diff --git a/packages/website/ts/components/ui/etherscan_icon.tsx b/packages/website/ts/components/ui/etherscan_icon.tsx index 12044f44b..9b4d172f1 100644 --- a/packages/website/ts/components/ui/etherscan_icon.tsx +++ b/packages/website/ts/components/ui/etherscan_icon.tsx @@ -1,7 +1,7 @@ import * as _ from 'lodash'; +import {colors} from 'material-ui/styles'; import * as React from 'react'; import ReactTooltip = require('react-tooltip'); -import {colors} from 'material-ui/styles'; import {EtherscanLinkSuffixes} from 'ts/types'; import {utils} from 'ts/utils/utils'; diff --git a/packages/website/ts/components/ui/fake_text_field.tsx b/packages/website/ts/components/ui/fake_text_field.tsx index 372785c2f..90bc47f01 100644 --- a/packages/website/ts/components/ui/fake_text_field.tsx +++ b/packages/website/ts/components/ui/fake_text_field.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import {colors} from 'material-ui/styles'; +import * as React from 'react'; import {InputLabel} from 'ts/components/ui/input_label'; import {Styles} from 'ts/types'; diff --git a/packages/website/ts/components/ui/flash_message.tsx b/packages/website/ts/components/ui/flash_message.tsx index 684aeef68..ab4edbbb0 100644 --- a/packages/website/ts/components/ui/flash_message.tsx +++ b/packages/website/ts/components/ui/flash_message.tsx @@ -1,6 +1,6 @@ import * as _ from 'lodash'; -import * as React from 'react'; import Snackbar from 'material-ui/Snackbar'; +import * as React from 'react'; import {Dispatcher} from 'ts/redux/dispatcher'; const SHOW_DURATION_MS = 4000; diff --git a/packages/website/ts/components/ui/identicon.tsx b/packages/website/ts/components/ui/identicon.tsx index 814548fb4..a741ae43b 100644 --- a/packages/website/ts/components/ui/identicon.tsx +++ b/packages/website/ts/components/ui/identicon.tsx @@ -1,7 +1,7 @@ +import blockies = require('blockies'); import * as _ from 'lodash'; import * as React from 'react'; import {constants} from 'ts/utils/constants'; -import blockies = require('blockies'); interface IdenticonProps { address: string; diff --git a/packages/website/ts/components/ui/input_label.tsx b/packages/website/ts/components/ui/input_label.tsx index 5866c70b6..852097519 100644 --- a/packages/website/ts/components/ui/input_label.tsx +++ b/packages/website/ts/components/ui/input_label.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import {colors} from 'material-ui/styles'; +import * as React from 'react'; export interface InputLabelProps { text: string | Element | React.ReactNode; diff --git a/packages/website/ts/components/ui/labeled_switcher.tsx b/packages/website/ts/components/ui/labeled_switcher.tsx index 3ed8ba0a4..80a8fbe94 100644 --- a/packages/website/ts/components/ui/labeled_switcher.tsx +++ b/packages/website/ts/components/ui/labeled_switcher.tsx @@ -1,6 +1,6 @@ import * as _ from 'lodash'; -import * as React from 'react'; import {colors} from 'material-ui/styles'; +import * as React from 'react'; const CUSTOM_BLUE = '#63A6F1'; @@ -61,12 +61,9 @@ export class LabeledSwitcher extends React.Component<LabeledSwitcherProps, Label this.setState({ isLeftSelected: isLeft, }); - let didSucceed; - if (isLeft) { - didSucceed = await this.props.onLeftLabelClickAsync(); - } else { - didSucceed = await this.props.onRightLabelClickAsync(); - } + const didSucceed = isLeft ? + await this.props.onLeftLabelClickAsync() : + await this.props.onRightLabelClickAsync(); if (!didSucceed) { this.setState({ isLeftSelected: !isLeft, diff --git a/packages/website/ts/components/ui/lifecycle_raised_button.tsx b/packages/website/ts/components/ui/lifecycle_raised_button.tsx index e93c80ba4..630f71545 100644 --- a/packages/website/ts/components/ui/lifecycle_raised_button.tsx +++ b/packages/website/ts/components/ui/lifecycle_raised_button.tsx @@ -1,9 +1,9 @@ import * as _ from 'lodash'; +import RaisedButton from 'material-ui/RaisedButton'; import * as React from 'react'; -import {utils} from 'ts/utils/utils'; -import {Token} from 'ts/types'; import {Blockchain} from 'ts/blockchain'; -import RaisedButton from 'material-ui/RaisedButton'; +import {Token} from 'ts/types'; +import {utils} from 'ts/utils/utils'; const COMPLETE_STATE_SHOW_LENGTH_MS = 2000; @@ -11,7 +11,7 @@ enum ButtonState { READY, LOADING, COMPLETE, -}; +} interface LifeCycleRaisedButtonProps { isHidden?: boolean; @@ -49,7 +49,7 @@ export class LifeCycleRaisedButton extends this.didUnmount = true; } public render() { - if (this.props.isHidden === true) { + if (this.props.isHidden) { return <span />; } @@ -83,7 +83,7 @@ export class LifeCycleRaisedButton extends this.setState({ buttonState: ButtonState.LOADING, }); - const didSucceed = await this.props.onClickAsyncFn(); + const didSucceed = this.props.onClickAsyncFn(); if (this.didUnmount) { return; // noop since unmount called before async callback returned. } diff --git a/packages/website/ts/components/ui/loading.tsx b/packages/website/ts/components/ui/loading.tsx index 39c119d8f..83636b5ff 100644 --- a/packages/website/ts/components/ui/loading.tsx +++ b/packages/website/ts/components/ui/loading.tsx @@ -1,9 +1,9 @@ import * as _ from 'lodash'; -import * as React from 'react'; import Paper from 'material-ui/Paper'; -import {utils} from 'ts/utils/utils'; +import * as React from 'react'; import {DefaultPlayer as Video} from 'react-html5video'; import 'react-html5video/dist/styles.css'; +import {utils} from 'ts/utils/utils'; interface LoadingProps {} diff --git a/packages/website/ts/components/ui/menu_item.tsx b/packages/website/ts/components/ui/menu_item.tsx index b9caa91fb..862f28457 100644 --- a/packages/website/ts/components/ui/menu_item.tsx +++ b/packages/website/ts/components/ui/menu_item.tsx @@ -1,9 +1,9 @@ import * as _ from 'lodash'; +import {colors} from 'material-ui/styles'; import * as React from 'react'; import {Link} from 'react-router-dom'; import {Styles} from 'ts/types'; import {constants} from 'ts/utils/constants'; -import {colors} from 'material-ui/styles'; interface MenuItemProps { to: string; diff --git a/packages/website/ts/components/ui/party.tsx b/packages/website/ts/components/ui/party.tsx index b72e75181..2927d9d3d 100644 --- a/packages/website/ts/components/ui/party.tsx +++ b/packages/website/ts/components/ui/party.tsx @@ -1,11 +1,11 @@ import * as _ from 'lodash'; +import {colors} from 'material-ui/styles'; import * as React from 'react'; import ReactTooltip = require('react-tooltip'); -import {colors} from 'material-ui/styles'; +import {EthereumAddress} from 'ts/components/ui/ethereum_address'; import {Identicon} from 'ts/components/ui/identicon'; import {EtherscanLinkSuffixes} from 'ts/types'; import {utils} from 'ts/utils/utils'; -import {EthereumAddress} from 'ts/components/ui/ethereum_address'; const MIN_ADDRESS_WIDTH = 60; const IMAGE_DIMENSION = 100; diff --git a/packages/website/ts/components/ui/required_label.tsx b/packages/website/ts/components/ui/required_label.tsx index f9c73157a..db69d7278 100644 --- a/packages/website/ts/components/ui/required_label.tsx +++ b/packages/website/ts/components/ui/required_label.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import {colors} from 'material-ui/styles'; +import * as React from 'react'; export interface RequiredLabelProps { label: string|React.ReactNode; diff --git a/packages/website/ts/components/ui/simple_loading.tsx b/packages/website/ts/components/ui/simple_loading.tsx index 12d09ecc4..d55d7851d 100644 --- a/packages/website/ts/components/ui/simple_loading.tsx +++ b/packages/website/ts/components/ui/simple_loading.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; -import {colors} from 'material-ui/styles'; import CircularProgress from 'material-ui/CircularProgress'; +import {colors} from 'material-ui/styles'; +import * as React from 'react'; export interface SimpleLoadingProps { message: string; diff --git a/packages/website/ts/components/ui/swap_icon.tsx b/packages/website/ts/components/ui/swap_icon.tsx index 89bb33d55..2e6ae89bb 100644 --- a/packages/website/ts/components/ui/swap_icon.tsx +++ b/packages/website/ts/components/ui/swap_icon.tsx @@ -1,7 +1,7 @@ import * as _ from 'lodash'; +import {colors} from 'material-ui/styles'; import * as React from 'react'; import {constants} from 'ts/utils/constants'; -import {colors} from 'material-ui/styles'; interface SwapIconProps { swapTokensFn: () => void; diff --git a/packages/website/ts/components/ui/token_icon.tsx b/packages/website/ts/components/ui/token_icon.tsx index 168c09bd4..d3a7c9a8c 100644 --- a/packages/website/ts/components/ui/token_icon.tsx +++ b/packages/website/ts/components/ui/token_icon.tsx @@ -1,7 +1,7 @@ import * as _ from 'lodash'; import * as React from 'react'; -import {Token} from 'ts/types'; import {Identicon} from 'ts/components/ui/identicon'; +import {Token} from 'ts/types'; interface TokenIconProps { token: Token; |