From fa7bd072d064d1c79c8e84bc42463491ebbad33f Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 9 Nov 2018 13:19:59 -0800 Subject: feat: refactor progress bar code to expose static progress bar --- .../src/components/zero_ex_instant_container.tsx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'packages/instant/src/components/zero_ex_instant_container.tsx') diff --git a/packages/instant/src/components/zero_ex_instant_container.tsx b/packages/instant/src/components/zero_ex_instant_container.tsx index b5f974cbe..f96174b63 100644 --- a/packages/instant/src/components/zero_ex_instant_container.tsx +++ b/packages/instant/src/components/zero_ex_instant_container.tsx @@ -9,14 +9,16 @@ import { SelectedAssetBuyOrderStateButtons } from '../containers/selected_asset_ import { SelectedAssetInstantHeading } from '../containers/selected_asset_instant_heading'; import { ColorOption } from '../style/theme'; import { zIndex } from '../style/z_index'; -import { SlideAnimationState } from '../types'; +import { OrderProcessState, SlideAnimationState } from '../types'; import { CSSReset } from './css_reset'; import { SlidingPanel } from './sliding_panel'; import { Container } from './ui/container'; import { Flex } from './ui/flex'; -export interface ZeroExInstantContainerProps {} +export interface ZeroExInstantContainerProps { + orderProcessState: OrderProcessState; +} export interface ZeroExInstantContainerState { tokenSelectionPanelAnimationState: SlideAnimationState; } @@ -48,7 +50,7 @@ export class ZeroExInstantContainer extends React.Component - + {this._renderPaymentMethodOrBuyOrderProgress()} @@ -76,4 +78,18 @@ export class ZeroExInstantContainer extends React.Component { + const { orderProcessState } = this.props; + if ( + orderProcessState === OrderProcessState.Processing || + orderProcessState === OrderProcessState.Success || + orderProcessState === OrderProcessState.Failure + ) { + return ; + } + if (orderProcessState === OrderProcessState.None) { + return ; + } + return null; + }; } -- cgit