aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/payment_method_dropdown.tsx
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 05:34:19 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-28 05:34:19 +0800
commitb95d73d176db7df99381a25270e98d5bcf954707 (patch)
treed90ddbb2b6d959eebee2132e30c0861894cab1e7 /packages/instant/src/components/payment_method_dropdown.tsx
parent462a5face9b2b24c1e9d20a6b894809faa512232 (diff)
parent47a87e57f1cfa82375c87829320f30049217d657 (diff)
downloaddexon-0x-contracts-b95d73d176db7df99381a25270e98d5bcf954707.tar
dexon-0x-contracts-b95d73d176db7df99381a25270e98d5bcf954707.tar.gz
dexon-0x-contracts-b95d73d176db7df99381a25270e98d5bcf954707.tar.bz2
dexon-0x-contracts-b95d73d176db7df99381a25270e98d5bcf954707.tar.lz
dexon-0x-contracts-b95d73d176db7df99381a25270e98d5bcf954707.tar.xz
dexon-0x-contracts-b95d73d176db7df99381a25270e98d5bcf954707.tar.zst
dexon-0x-contracts-b95d73d176db7df99381a25270e98d5bcf954707.zip
Merge branch 'development' into feature/instant/install-analytics
Diffstat (limited to 'packages/instant/src/components/payment_method_dropdown.tsx')
-rw-r--r--packages/instant/src/components/payment_method_dropdown.tsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/instant/src/components/payment_method_dropdown.tsx b/packages/instant/src/components/payment_method_dropdown.tsx
index 0226d1f01..872ac0831 100644
--- a/packages/instant/src/components/payment_method_dropdown.tsx
+++ b/packages/instant/src/components/payment_method_dropdown.tsx
@@ -3,6 +3,7 @@ import * as copy from 'copy-to-clipboard';
import * as React from 'react';
import { Network } from '../types';
+import { analytics } from '../util/analytics';
import { envUtil } from '../util/env';
import { etherscanUtil } from '../util/etherscan';
import { format } from '../util/format';
@@ -20,7 +21,14 @@ export class PaymentMethodDropdown extends React.Component<PaymentMethodDropdown
const { accountAddress, accountEthBalanceInWei } = this.props;
const value = format.ethAddress(accountAddress);
const label = format.ethBaseUnitAmount(accountEthBalanceInWei, 4, '') as string;
- return <Dropdown value={value} label={label} items={this._getDropdownItemConfigs()} />;
+ return (
+ <Dropdown
+ value={value}
+ label={label}
+ items={this._getDropdownItemConfigs()}
+ onOpen={analytics.trackPaymentMethodDropdownOpened}
+ />
+ );
}
private readonly _getDropdownItemConfigs = (): DropdownItemConfig[] => {
if (envUtil.isMobileOperatingSystem()) {
@@ -37,11 +45,15 @@ export class PaymentMethodDropdown extends React.Component<PaymentMethodDropdown
return [viewOnEtherscan, copyAddressToClipboard];
};
private readonly _handleEtherscanClick = (): void => {
+ analytics.trackPaymentMethodOpenedEtherscan();
+
const { accountAddress, network } = this.props;
const etherscanUrl = etherscanUtil.getEtherScanEthAddressIfExists(accountAddress, network);
window.open(etherscanUrl, '_blank');
};
private readonly _handleCopyToClipboardClick = (): void => {
+ analytics.trackPaymentMethodCopiedAddress();
+
const { accountAddress } = this.props;
copy(accountAddress);
};