From db3ad83ebca88e0faf2529ec468044e6ce4d5746 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Wed, 24 Oct 2018 13:16:28 -0700 Subject: Introduce new OrderProcessState --- packages/instant/src/components/buy_order_state_button.tsx | 13 ++++++++----- packages/instant/src/components/instant_heading.tsx | 10 +++++----- 2 files changed, 13 insertions(+), 10 deletions(-) (limited to 'packages/instant/src/components') 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 = props => { - if (props.buyOrderProcessingState === AsyncProcessState.FAILURE) { + if (props.buyOrderProcessingState === OrderProcessState.FAILURE) { return ; - } else if (props.buyOrderProcessingState === AsyncProcessState.SUCCESS) { + } else if (props.buyOrderProcessingState === OrderProcessState.SUCCESS) { return ; - } else if (props.buyOrderProcessingState === AsyncProcessState.PENDING) { + } else if ( + props.buyOrderProcessingState === OrderProcessState.AWAITING_SIGNATURE || + props.buyOrderProcessingState === OrderProcessState.PROCESSING + ) { return ; } 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 { private _renderIcon(): React.ReactNode { const processState = this.props.buyOrderState.processState; - if (processState === AsyncProcessState.FAILURE) { + if (processState === OrderProcessState.FAILURE) { return ; - } else if (processState === AsyncProcessState.SUCCESS) { + } else if (processState === OrderProcessState.SUCCESS) { return ; } return undefined; @@ -78,9 +78,9 @@ export class InstantHeading extends React.Component { 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!'; } -- cgit v1.2.3