diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-16 02:38:23 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2019-01-16 02:38:23 +0800 |
commit | 7a2b312d64994f96db75864e9a61bb319efdda3a (patch) | |
tree | 6d7b030abe774c619067ae52e0ef1cf7ebdd0963 /packages/website/ts/components/ui/lifecycle_raised_button.tsx | |
parent | 64a78149aa4a35aa339fb9ef80faea613ebaeffd (diff) | |
parent | f570f80674c22f69712c45e8e3c48e948b51f357 (diff) | |
download | dexon-0x-contracts-7a2b312d64994f96db75864e9a61bb319efdda3a.tar dexon-0x-contracts-7a2b312d64994f96db75864e9a61bb319efdda3a.tar.gz dexon-0x-contracts-7a2b312d64994f96db75864e9a61bb319efdda3a.tar.bz2 dexon-0x-contracts-7a2b312d64994f96db75864e9a61bb319efdda3a.tar.lz dexon-0x-contracts-7a2b312d64994f96db75864e9a61bb319efdda3a.tar.xz dexon-0x-contracts-7a2b312d64994f96db75864e9a61bb319efdda3a.tar.zst dexon-0x-contracts-7a2b312d64994f96db75864e9a61bb319efdda3a.zip |
Merge branch 'development' into fix/asset-buyer/zero-amount-available-test
Diffstat (limited to 'packages/website/ts/components/ui/lifecycle_raised_button.tsx')
-rw-r--r-- | packages/website/ts/components/ui/lifecycle_raised_button.tsx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/packages/website/ts/components/ui/lifecycle_raised_button.tsx b/packages/website/ts/components/ui/lifecycle_raised_button.tsx index a8daf4102..f004dd47f 100644 --- a/packages/website/ts/components/ui/lifecycle_raised_button.tsx +++ b/packages/website/ts/components/ui/lifecycle_raised_button.tsx @@ -6,9 +6,9 @@ import * as React from 'react'; const COMPLETE_STATE_SHOW_LENGTH_MS = 2000; enum ButtonState { - READY, - LOADING, - COMPLETE, + Ready, + Loading, + Complete, } interface LifeCycleRaisedButtonProps { @@ -38,7 +38,7 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton constructor(props: LifeCycleRaisedButtonProps) { super(props); this.state = { - buttonState: ButtonState.READY, + buttonState: ButtonState.Ready, }; } public componentWillUnmount(): void { @@ -52,13 +52,13 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton let label; switch (this.state.buttonState) { - case ButtonState.READY: + case ButtonState.Ready: label = this.props.labelReady; break; - case ButtonState.LOADING: + case ButtonState.Loading: label = this.props.labelLoading; break; - case ButtonState.COMPLETE: + case ButtonState.Complete: label = this.props.labelComplete; break; default: @@ -72,13 +72,13 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton backgroundColor={this.props.backgroundColor} labelColor={this.props.labelColor} onClick={this.onClickAsync.bind(this)} - disabled={this.props.isDisabled || this.state.buttonState !== ButtonState.READY} + disabled={this.props.isDisabled || this.state.buttonState !== ButtonState.Ready} /> ); } public async onClickAsync(): Promise<void> { this.setState({ - buttonState: ButtonState.LOADING, + buttonState: ButtonState.Loading, }); const didSucceed = await this.props.onClickAsyncFn(); if (this._didUnmount) { @@ -86,16 +86,16 @@ export class LifeCycleRaisedButton extends React.Component<LifeCycleRaisedButton } if (didSucceed) { this.setState({ - buttonState: ButtonState.COMPLETE, + buttonState: ButtonState.Complete, }); this._buttonTimeoutId = window.setTimeout(() => { this.setState({ - buttonState: ButtonState.READY, + buttonState: ButtonState.Ready, }); }, COMPLETE_STATE_SHOW_LENGTH_MS); } else { this.setState({ - buttonState: ButtonState.READY, + buttonState: ButtonState.Ready, }); } } |