diff options
author | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 09:46:33 +0800 |
---|---|---|
committer | Steve Klebanoff <steve.klebanoff@gmail.com> | 2018-10-26 09:46:33 +0800 |
commit | 39f92e4c958590a58ac5c48db197f98fdd9723e1 (patch) | |
tree | 3f0f136430f378b66f3c4befd4817953a2116f9c /packages/instant/src/containers/selected_asset_view_transaction_button.tsx | |
parent | ced4c893ba412ca401430a66694e194806d46e6b (diff) | |
download | dexon-sol-tools-39f92e4c958590a58ac5c48db197f98fdd9723e1.tar dexon-sol-tools-39f92e4c958590a58ac5c48db197f98fdd9723e1.tar.gz dexon-sol-tools-39f92e4c958590a58ac5c48db197f98fdd9723e1.tar.bz2 dexon-sol-tools-39f92e4c958590a58ac5c48db197f98fdd9723e1.tar.lz dexon-sol-tools-39f92e4c958590a58ac5c48db197f98fdd9723e1.tar.xz dexon-sol-tools-39f92e4c958590a58ac5c48db197f98fdd9723e1.tar.zst dexon-sol-tools-39f92e4c958590a58ac5c48db197f98fdd9723e1.zip |
Get BuyOrderState one big connected component, and let user view failure
Diffstat (limited to 'packages/instant/src/containers/selected_asset_view_transaction_button.tsx')
-rw-r--r-- | packages/instant/src/containers/selected_asset_view_transaction_button.tsx | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/packages/instant/src/containers/selected_asset_view_transaction_button.tsx b/packages/instant/src/containers/selected_asset_view_transaction_button.tsx deleted file mode 100644 index c74f07209..000000000 --- a/packages/instant/src/containers/selected_asset_view_transaction_button.tsx +++ /dev/null @@ -1,43 +0,0 @@ -import * as _ from 'lodash'; -import * as React from 'react'; -import { connect } from 'react-redux'; - -import { State } from '../redux/reducer'; - -import { ViewTransactionButton } from '../components/view_transaction_button'; -import { OrderProcessState } from '../types'; -import { etherscanUtil } from '../util/etherscan'; - -export interface SelectedAssetViewTransactionButtonProps { - width?: string; -} - -interface ConnectedState { - onClick: () => void; - width?: string; -} - -const mapStateToProps = (state: State, ownProps: SelectedAssetViewTransactionButtonProps): ConnectedState => ({ - onClick: () => { - if ( - state.assetBuyer && - (state.buyOrderState.processState === OrderProcessState.PROCESSING || - state.buyOrderState.processState === OrderProcessState.SUCCESS || - state.buyOrderState.processState === OrderProcessState.FAILURE) - ) { - const etherscanUrl = etherscanUtil.getEtherScanTxnAddressIfExists( - state.buyOrderState.txHash, - state.assetBuyer.networkId, - ); - if (etherscanUrl) { - window.open(etherscanUrl, '_blank'); - return; - } - } - }, - width: ownProps.width, -}); - -export const SelectedAssetViewTransactionButton: React.ComponentClass< - SelectedAssetViewTransactionButtonProps -> = connect(mapStateToProps)(ViewTransactionButton); |