aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers/selected_asset_buy_button.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-24 08:06:45 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-10-24 08:06:45 +0800
commit4c4286ac662d3dba928bf16b83ade5e5476f4614 (patch)
treebce36f2ff8fce37e690409584ffe00bc391cebf1 /packages/instant/src/containers/selected_asset_buy_button.ts
parent194cbc3ba941023a0b6c1845a867ccfd619b754f (diff)
downloaddexon-0x-contracts-4c4286ac662d3dba928bf16b83ade5e5476f4614.tar.gz
dexon-0x-contracts-4c4286ac662d3dba928bf16b83ade5e5476f4614.tar.zst
dexon-0x-contracts-4c4286ac662d3dba928bf16b83ade5e5476f4614.zip
feat(instant): Procesing and Success states
Diffstat (limited to 'packages/instant/src/containers/selected_asset_buy_button.ts')
-rw-r--r--packages/instant/src/containers/selected_asset_buy_button.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/packages/instant/src/containers/selected_asset_buy_button.ts b/packages/instant/src/containers/selected_asset_buy_button.ts
index 208bb2582..71d2b8cf0 100644
--- a/packages/instant/src/containers/selected_asset_buy_button.ts
+++ b/packages/instant/src/containers/selected_asset_buy_button.ts
@@ -19,7 +19,7 @@ interface ConnectedState {
interface ConnectedDispatch {
onClick: (buyQuote: BuyQuote) => void;
- onBuySuccess: (buyQuote: BuyQuote) => void;
+ onBuySuccess: (buyQuote: BuyQuote, txnHash: string) => void;
onBuyFailure: (buyQuote: BuyQuote) => void;
}
@@ -29,9 +29,10 @@ const mapStateToProps = (state: State, _ownProps: SelectedAssetBuyButtonProps):
});
const mapDispatchToProps = (dispatch: Dispatch<Action>, ownProps: SelectedAssetBuyButtonProps): ConnectedDispatch => ({
- onClick: buyQuote => dispatch(actions.updateBuyOrderState(AsyncProcessState.PENDING)),
- onBuySuccess: buyQuote => dispatch(actions.updateBuyOrderState(AsyncProcessState.SUCCESS)),
- onBuyFailure: buyQuote => dispatch(actions.updateBuyOrderState(AsyncProcessState.FAILURE)),
+ onClick: buyQuote => dispatch(actions.updateBuyOrderState({ processState: AsyncProcessState.PENDING })),
+ onBuySuccess: (buyQuote: BuyQuote, txnHash: string) =>
+ dispatch(actions.updateBuyOrderState({ processState: AsyncProcessState.SUCCESS, txnHash })),
+ onBuyFailure: buyQuote => dispatch(actions.updateBuyOrderState({ processState: AsyncProcessState.FAILURE })),
});
export const SelectedAssetBuyButton: React.ComponentClass<SelectedAssetBuyButtonProps> = connect(