aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 03:25:51 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 03:25:51 +0800
commitb50187f59c09d4ecf7a840fd22f96bcecd14bb1b (patch)
tree6d6f679365653759787689d3237a6c9903f610c6 /packages/instant/src/containers
parent4653e4c011410b67b0be0335aa1f44dfade86a2e (diff)
downloaddexon-sol-tools-b50187f59c09d4ecf7a840fd22f96bcecd14bb1b.tar
dexon-sol-tools-b50187f59c09d4ecf7a840fd22f96bcecd14bb1b.tar.gz
dexon-sol-tools-b50187f59c09d4ecf7a840fd22f96bcecd14bb1b.tar.bz2
dexon-sol-tools-b50187f59c09d4ecf7a840fd22f96bcecd14bb1b.tar.lz
dexon-sol-tools-b50187f59c09d4ecf7a840fd22f96bcecd14bb1b.tar.xz
dexon-sol-tools-b50187f59c09d4ecf7a840fd22f96bcecd14bb1b.tar.zst
dexon-sol-tools-b50187f59c09d4ecf7a840fd22f96bcecd14bb1b.zip
Track install wallet clicked
Diffstat (limited to 'packages/instant/src/containers')
-rw-r--r--packages/instant/src/containers/connected_account_payment_method.ts37
1 files changed, 21 insertions, 16 deletions
diff --git a/packages/instant/src/containers/connected_account_payment_method.ts b/packages/instant/src/containers/connected_account_payment_method.ts
index cdeb49a25..e9327a288 100644
--- a/packages/instant/src/containers/connected_account_payment_method.ts
+++ b/packages/instant/src/containers/connected_account_payment_method.ts
@@ -11,7 +11,7 @@ import {
import { Action, actions } from '../redux/actions';
import { asyncData } from '../redux/async_data';
import { State } from '../redux/reducer';
-import { Network, Omit, OperatingSystem, ProviderState, StandardSlidingPanelContent } from '../types';
+import { Network, Omit, OperatingSystem, ProviderState, StandardSlidingPanelContent, WalletSuggestion } from '../types';
import { analytics } from '../util/analytics';
import { envUtil } from '../util/env';
@@ -60,23 +60,28 @@ const mergeProps = (
onUnlockWalletClick: () => connectedDispatch.unlockWalletAndDispatchToStore(connectedState.providerState),
onInstallWalletClick: () => {
const isMobile = envUtil.isMobileOperatingSystem();
- if (!isMobile) {
+ const walletSuggestion: WalletSuggestion = isMobile
+ ? WalletSuggestion.CoinbaseWallet
+ : WalletSuggestion.MetaMask;
+
+ analytics.trackInstallWalletClicked(walletSuggestion);
+ if (walletSuggestion === WalletSuggestion.MetaMask) {
connectedDispatch.openInstallWalletPanel();
- return;
- }
- const operatingSystem = envUtil.getOperatingSystem();
- let url = COINBASE_WALLET_SITE_URL;
- switch (operatingSystem) {
- case OperatingSystem.Android:
- url = COINBASE_WALLET_ANDROID_APP_STORE_URL;
- break;
- case OperatingSystem.iOS:
- url = COINBASE_WALLET_IOS_APP_STORE_URL;
- break;
- default:
- break;
+ } else {
+ const operatingSystem = envUtil.getOperatingSystem();
+ let url = COINBASE_WALLET_SITE_URL;
+ switch (operatingSystem) {
+ case OperatingSystem.Android:
+ url = COINBASE_WALLET_ANDROID_APP_STORE_URL;
+ break;
+ case OperatingSystem.iOS:
+ url = COINBASE_WALLET_IOS_APP_STORE_URL;
+ break;
+ default:
+ break;
+ }
+ window.open(url, '_blank');
}
- window.open(url, '_blank');
},
});