diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 08:28:27 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 08:28:27 +0800 |
commit | d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6 (patch) | |
tree | 1577ddb345492554c1c4e4642e72d5d34b8a3bae /packages/instant/src/components | |
parent | 3cd9f40e63d82c983ce10963c62432c87808f993 (diff) | |
download | dexon-sol-tools-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar dexon-sol-tools-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar.gz dexon-sol-tools-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar.bz2 dexon-sol-tools-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar.lz dexon-sol-tools-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar.xz dexon-sol-tools-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar.zst dexon-sol-tools-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.zip |
move buy order state to its own component
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r-- | packages/instant/src/components/buy_order_state_button.tsx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/packages/instant/src/components/buy_order_state_button.tsx b/packages/instant/src/components/buy_order_state_button.tsx new file mode 100644 index 000000000..e7641e7e7 --- /dev/null +++ b/packages/instant/src/components/buy_order_state_button.tsx @@ -0,0 +1,24 @@ +import * as React from 'react'; + +import { SelectedAssetBuyButton } from '../containers/selected_asset_buy_button'; +import { SelectedAssetRetryButton } from '../containers/selected_asset_retry_button'; + +import { AsyncProcessState } from '../types'; + +import { SecondaryButton } from './secondary_button'; + +export interface BuyOrderStateButtonProps { + buyOrderState: AsyncProcessState; +} + +export const BuyOrderStateButton: React.StatelessComponent<BuyOrderStateButtonProps> = props => { + if (props.buyOrderState === AsyncProcessState.FAILURE) { + return <SelectedAssetRetryButton />; + } else if (props.buyOrderState === AsyncProcessState.SUCCESS) { + return <SecondaryButton text="Success" isDisabled={true} />; + } else if (props.buyOrderState === AsyncProcessState.PENDING) { + return <SecondaryButton text="Processing" isDisabled={true} />; + } + + return <SelectedAssetBuyButton />; +}; |