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/containers | |
parent | 3cd9f40e63d82c983ce10963c62432c87808f993 (diff) | |
download | dexon-0x-contracts-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar.gz dexon-0x-contracts-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.tar.zst dexon-0x-contracts-d43f89fa0af709b1c1616ab5cfb32b8c27e07ab6.zip |
move buy order state to its own component
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r-- | packages/instant/src/containers/selected_asset_button.tsx | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/packages/instant/src/containers/selected_asset_button.tsx b/packages/instant/src/containers/selected_asset_button.tsx index 8c617804e..86be291bc 100644 --- a/packages/instant/src/containers/selected_asset_button.tsx +++ b/packages/instant/src/containers/selected_asset_button.tsx @@ -2,12 +2,10 @@ import * as _ from 'lodash'; import * as React from 'react'; import { connect } from 'react-redux'; -import { SecondaryButton } from '../components/secondary_button'; import { State } from '../redux/reducer'; import { AsyncProcessState } from '../types'; -import { SelectedAssetBuyButton } from './selected_asset_buy_button'; -import { SelectedAssetRetryButton } from './selected_asset_retry_button'; +import { BuyOrderStateButton } from '../components/buy_order_state_button'; interface ConnectedState { buyOrderState: AsyncProcessState; @@ -17,20 +15,6 @@ const mapStateToProps = (state: State, _ownProps: SelectedAssetButtonProps): Con buyOrderState: state.buyOrderState, }); -const SelectedAssetButtonPresentationComponent: React.StatelessComponent<{ - buyOrderState: AsyncProcessState; -}> = 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 />; -}; - export const SelectedAssetButton: React.ComponentClass<SelectedAssetButtonProps> = connect(mapStateToProps)( - SelectedAssetButtonPresentationComponent, + BuyOrderStateButton, ); |