diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 08:06:45 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-24 08:06:45 +0800 |
commit | 4c4286ac662d3dba928bf16b83ade5e5476f4614 (patch) | |
tree | bce36f2ff8fce37e690409584ffe00bc391cebf1 /packages/instant/src/containers/selected_asset_buy_button.ts | |
parent | 194cbc3ba941023a0b6c1845a867ccfd619b754f (diff) | |
download | dexon-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.ts | 9 |
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( |