diff options
author | Steve Klebanoff <steve@0xproject.com> | 2018-11-29 06:01:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-29 06:01:07 +0800 |
commit | e5b09ba2fd366e485a864bc5819ebde5338f166c (patch) | |
tree | d2c7e80d7a71bab5d311a111dc7490dc6863c0e1 /packages/instant/src/containers/connected_account_payment_method.ts | |
parent | 53f8e1b3b426424bf4459605b48e706eb7fb6d90 (diff) | |
parent | b95d73d176db7df99381a25270e98d5bcf954707 (diff) | |
download | dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar.gz dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar.bz2 dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar.lz dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar.xz dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.tar.zst dexon-sol-tools-e5b09ba2fd366e485a864bc5819ebde5338f166c.zip |
Merge pull request #1341 from 0xProject/feature/instant/install-analytics
[instant] Install Wallet analytic events
Diffstat (limited to 'packages/instant/src/containers/connected_account_payment_method.ts')
-rw-r--r-- | packages/instant/src/containers/connected_account_payment_method.ts | 37 |
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'); }, }); |