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 ++++++++++++++++++++++ 2 files changed, 63 insertions(+), 63 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/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 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 ( + + ); +}; -- cgit v1.2.3