aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-25 04:16:28 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-25 04:24:35 +0800
commitdb3ad83ebca88e0faf2529ec468044e6ce4d5746 (patch)
tree3929a5f13c59e428644162669a93902effa5f051 /packages/instant/src/components
parent979527a5ee3efaf2974703b91b0af3440195219e (diff)
downloaddexon-sol-tools-db3ad83ebca88e0faf2529ec468044e6ce4d5746.tar
dexon-sol-tools-db3ad83ebca88e0faf2529ec468044e6ce4d5746.tar.gz
dexon-sol-tools-db3ad83ebca88e0faf2529ec468044e6ce4d5746.tar.bz2
dexon-sol-tools-db3ad83ebca88e0faf2529ec468044e6ce4d5746.tar.lz
dexon-sol-tools-db3ad83ebca88e0faf2529ec468044e6ce4d5746.tar.xz
dexon-sol-tools-db3ad83ebca88e0faf2529ec468044e6ce4d5746.tar.zst
dexon-sol-tools-db3ad83ebca88e0faf2529ec468044e6ce4d5746.zip
Introduce new OrderProcessState
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/buy_order_state_button.tsx13
-rw-r--r--packages/instant/src/components/instant_heading.tsx10
2 files changed, 13 insertions, 10 deletions
diff --git a/packages/instant/src/components/buy_order_state_button.tsx b/packages/instant/src/components/buy_order_state_button.tsx
index 5bc965c7d..b5b21fd1e 100644
--- a/packages/instant/src/components/buy_order_state_button.tsx
+++ b/packages/instant/src/components/buy_order_state_button.tsx
@@ -4,18 +4,21 @@ import { PlacingOrderButton } from '../components/placing_order_button';
import { SelectedAssetBuyButton } from '../containers/selected_asset_buy_button';
import { SelectedAssetRetryButton } from '../containers/selected_asset_retry_button';
import { SelectedAssetViewTransactionButton } from '../containers/selected_asset_view_transaction_button';
-import { AsyncProcessState } from '../types';
+import { OrderProcessState } from '../types';
export interface BuyOrderStateButtonProps {
- buyOrderProcessingState: AsyncProcessState;
+ buyOrderProcessingState: OrderProcessState;
}
export const BuyOrderStateButton: React.StatelessComponent<BuyOrderStateButtonProps> = props => {
- if (props.buyOrderProcessingState === AsyncProcessState.FAILURE) {
+ if (props.buyOrderProcessingState === OrderProcessState.FAILURE) {
return <SelectedAssetRetryButton />;
- } else if (props.buyOrderProcessingState === AsyncProcessState.SUCCESS) {
+ } else if (props.buyOrderProcessingState === OrderProcessState.SUCCESS) {
return <SelectedAssetViewTransactionButton />;
- } else if (props.buyOrderProcessingState === AsyncProcessState.PENDING) {
+ } else if (
+ props.buyOrderProcessingState === OrderProcessState.AWAITING_SIGNATURE ||
+ props.buyOrderProcessingState === OrderProcessState.PROCESSING
+ ) {
return <PlacingOrderButton />;
}
diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx
index ed753a3bd..37d87580d 100644
--- a/packages/instant/src/components/instant_heading.tsx
+++ b/packages/instant/src/components/instant_heading.tsx
@@ -4,7 +4,7 @@ import * as React from 'react';
import { SelectedAssetAmountInput } from '../containers/selected_asset_amount_input';
import { ColorOption } from '../style/theme';
-import { AsyncProcessState, OrderState } from '../types';
+import { AsyncProcessState, OrderProcessState, OrderState } from '../types';
import { format } from '../util/format';
import { AmountPlaceholder } from './amount_placeholder';
@@ -68,9 +68,9 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> {
private _renderIcon(): React.ReactNode {
const processState = this.props.buyOrderState.processState;
- if (processState === AsyncProcessState.FAILURE) {
+ if (processState === OrderProcessState.FAILURE) {
return <Icon icon={'failed'} width={ICON_WIDTH} height={ICON_HEIGHT} color={ICON_COLOR} />;
- } else if (processState === AsyncProcessState.SUCCESS) {
+ } else if (processState === OrderProcessState.SUCCESS) {
return <Icon icon={'success'} width={ICON_WIDTH} height={ICON_HEIGHT} color={ICON_COLOR} />;
}
return undefined;
@@ -78,9 +78,9 @@ export class InstantHeading extends React.Component<InstantHeadingProps, {}> {
private _renderTopText(): React.ReactNode {
const processState = this.props.buyOrderState.processState;
- if (processState === AsyncProcessState.FAILURE) {
+ if (processState === OrderProcessState.FAILURE) {
return 'Order failed';
- } else if (processState === AsyncProcessState.SUCCESS) {
+ } else if (processState === OrderProcessState.SUCCESS) {
return 'Tokens received!';
}