From 7fa1f25e065c737e7589b57fb0249db5c1ceb4fb Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Fri, 26 Oct 2018 12:53:04 -0700 Subject: buy order state button -> buy order state buttons --- .../src/components/buy_order_state_button.tsx | 63 ---------------------- .../src/components/buy_order_state_buttons.tsx | 63 ++++++++++++++++++++++ .../selected_asset_buy_order_state_button.ts | 4 +- 3 files changed, 65 insertions(+), 65 deletions(-) delete mode 100644 packages/instant/src/components/buy_order_state_button.tsx create mode 100644 packages/instant/src/components/buy_order_state_buttons.tsx (limited to 'packages') diff --git a/packages/instant/src/components/buy_order_state_button.tsx b/packages/instant/src/components/buy_order_state_button.tsx deleted file mode 100644 index 17aa46df5..000000000 --- a/packages/instant/src/components/buy_order_state_button.tsx +++ /dev/null @@ -1,63 +0,0 @@ -import { AssetBuyer, BuyQuote } from '@0x/asset-buyer'; -import * as React from 'react'; - -import { Flex } from '../components/ui/flex'; -import { SecondaryButton } from '../components/secondary_button'; -import { BuyButton } from '../components/buy_button'; - -import { PlacingOrderButton } from '../components/placing_order_button'; -import { ColorOption } from '../style/theme'; -import { OrderProcessState } from '../types'; - -import { Button } from './ui/button'; -import { Text } from './ui/text'; - -export interface BuyOrderStateButtonProps { - buyQuote?: BuyQuote; - buyOrderProcessingState: OrderProcessState; - assetBuyer?: AssetBuyer; - onViewTransaction: () => void; - onAwaitingSignature: (buyQuote: BuyQuote) => void; - onSignatureDenied: (buyQuote: BuyQuote, error: Error) => void; - onBuyProcessing: (buyQuote: BuyQuote, txHash: string) => void; - onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void; - onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void; - onRetry: () => void; -} - -// TODO: rename to buttons -export const BuyOrderStateButton: React.StatelessComponent = props => { - if (props.buyOrderProcessingState === OrderProcessState.FAILURE) { - return ( - - - - Details - - - ); - } else if ( - props.buyOrderProcessingState === OrderProcessState.SUCCESS || - props.buyOrderProcessingState === OrderProcessState.PROCESSING - ) { - return View Transaction; - } else if (props.buyOrderProcessingState === OrderProcessState.AWAITING_SIGNATURE) { - return ; - } - - return ( - - ); -}; diff --git a/packages/instant/src/components/buy_order_state_buttons.tsx b/packages/instant/src/components/buy_order_state_buttons.tsx new file mode 100644 index 000000000..2330f84f9 --- /dev/null +++ b/packages/instant/src/components/buy_order_state_buttons.tsx @@ -0,0 +1,63 @@ +import { AssetBuyer, BuyQuote } from '@0x/asset-buyer'; +import * as React from 'react'; + +import { Flex } from '../components/ui/flex'; +import { SecondaryButton } from '../components/secondary_button'; +import { BuyButton } from '../components/buy_button'; + +import { PlacingOrderButton } from '../components/placing_order_button'; +import { ColorOption } from '../style/theme'; +import { OrderProcessState } from '../types'; + +import { Button } from './ui/button'; +import { Text } from './ui/text'; + +export interface BuyOrderStateButtonProps { + buyQuote?: BuyQuote; + buyOrderProcessingState: OrderProcessState; + assetBuyer?: AssetBuyer; + onViewTransaction: () => void; + onAwaitingSignature: (buyQuote: BuyQuote) => void; + onSignatureDenied: (buyQuote: BuyQuote, error: Error) => void; + onBuyProcessing: (buyQuote: BuyQuote, txHash: string) => void; + onBuySuccess: (buyQuote: BuyQuote, txHash: string) => void; + onBuyFailure: (buyQuote: BuyQuote, txHash: string) => void; + onRetry: () => void; +} + +// TODO: rename to buttons +export const BuyOrderStateButtons: React.StatelessComponent = props => { + if (props.buyOrderProcessingState === OrderProcessState.FAILURE) { + return ( + + + + Details + + + ); + } else if ( + props.buyOrderProcessingState === OrderProcessState.SUCCESS || + props.buyOrderProcessingState === OrderProcessState.PROCESSING + ) { + return View Transaction; + } else if (props.buyOrderProcessingState === OrderProcessState.AWAITING_SIGNATURE) { + return ; + } + + return ( + + ); +}; diff --git a/packages/instant/src/containers/selected_asset_buy_order_state_button.ts b/packages/instant/src/containers/selected_asset_buy_order_state_button.ts index fa5de4e68..43c62c773 100644 --- a/packages/instant/src/containers/selected_asset_buy_order_state_button.ts +++ b/packages/instant/src/containers/selected_asset_buy_order_state_button.ts @@ -9,7 +9,7 @@ import { State } from '../redux/reducer'; import { OrderProcessState, OrderState } from '../types'; import { etherscanUtil } from '../util/etherscan'; -import { BuyOrderStateButton } from '../components/buy_order_state_button'; +import { BuyOrderStateButtons } from '../components/buy_order_state_buttons'; interface ConnectedState { buyQuote?: BuyQuote; @@ -75,4 +75,4 @@ const mapDispatchToProps = (dispatch: Dispatch, ownProps: SelectedAssetB export const SelectedAssetBuyOrderStateButton: React.ComponentClass = connect( mapStateToProps, mapDispatchToProps, -)(BuyOrderStateButton); +)(BuyOrderStateButtons); -- cgit v1.2.3