From 4c4286ac662d3dba928bf16b83ade5e5476f4614 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Tue, 23 Oct 2018 17:06:45 -0700
Subject: feat(instant): Procesing and Success states

---
 .../selected_asset_view_transaction_button.tsx     | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 packages/instant/src/containers/selected_asset_view_transaction_button.tsx

(limited to 'packages/instant/src/containers/selected_asset_view_transaction_button.tsx')

diff --git a/packages/instant/src/containers/selected_asset_view_transaction_button.tsx b/packages/instant/src/containers/selected_asset_view_transaction_button.tsx
new file mode 100644
index 000000000..44de16c4a
--- /dev/null
+++ b/packages/instant/src/containers/selected_asset_view_transaction_button.tsx
@@ -0,0 +1,35 @@
+import { EtherscanLinkSuffixes, utils } from '@0x/react-shared';
+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 { AsyncProcessState } from '../types';
+
+export interface SelectedAssetViewTransactionButtonProps {}
+
+interface ConnectedState {
+    onClick: () => void;
+}
+
+const mapStateToProps = (state: State, _ownProps: {}): ConnectedState => ({
+    onClick: () => {
+        if (state.assetBuyer && state.buyOrderState.processState === AsyncProcessState.SUCCESS) {
+            const etherscanUrl = utils.getEtherScanLinkIfExists(
+                state.buyOrderState.txnHash,
+                state.assetBuyer.networkId,
+                EtherscanLinkSuffixes.Tx,
+            );
+            if (etherscanUrl) {
+                window.open(etherscanUrl, '_blank');
+                return;
+            }
+        }
+    },
+});
+
+export const SelectedAssetViewTransactionButton: React.ComponentClass<
+    SelectedAssetViewTransactionButtonProps
+> = connect(mapStateToProps)(ViewTransactionButton);
-- 
cgit v1.2.3


From 09f0bf7f0062bba51380ae904bff96baddf5f0f2 Mon Sep 17 00:00:00 2001
From: Steve Klebanoff <steve.klebanoff@gmail.com>
Date: Wed, 24 Oct 2018 11:50:05 -0700
Subject: Get rid of react-shared as a dependency, write own etherscanUtil

---
 .../src/containers/selected_asset_view_transaction_button.tsx        | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

(limited to 'packages/instant/src/containers/selected_asset_view_transaction_button.tsx')

diff --git a/packages/instant/src/containers/selected_asset_view_transaction_button.tsx b/packages/instant/src/containers/selected_asset_view_transaction_button.tsx
index 44de16c4a..6f42b9f85 100644
--- a/packages/instant/src/containers/selected_asset_view_transaction_button.tsx
+++ b/packages/instant/src/containers/selected_asset_view_transaction_button.tsx
@@ -1,4 +1,3 @@
-import { EtherscanLinkSuffixes, utils } from '@0x/react-shared';
 import * as _ from 'lodash';
 import * as React from 'react';
 import { connect } from 'react-redux';
@@ -7,6 +6,7 @@ import { State } from '../redux/reducer';
 
 import { ViewTransactionButton } from '../components/view_transaction_button';
 import { AsyncProcessState } from '../types';
+import { etherscanUtil } from '../util/etherscan';
 
 export interface SelectedAssetViewTransactionButtonProps {}
 
@@ -17,10 +17,9 @@ interface ConnectedState {
 const mapStateToProps = (state: State, _ownProps: {}): ConnectedState => ({
     onClick: () => {
         if (state.assetBuyer && state.buyOrderState.processState === AsyncProcessState.SUCCESS) {
-            const etherscanUrl = utils.getEtherScanLinkIfExists(
+            const etherscanUrl = etherscanUtil.getEtherScanTxnAddressIfExists(
                 state.buyOrderState.txnHash,
                 state.assetBuyer.networkId,
-                EtherscanLinkSuffixes.Tx,
             );
             if (etherscanUrl) {
                 window.open(etherscanUrl, '_blank');
-- 
cgit v1.2.3

