diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-06-15 01:28:02 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-06-15 06:43:10 +0800 |
commit | 677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6 (patch) | |
tree | 100c8dcf3bc59996c2a95fa3e0ec056dde5dc8c5 /packages/website/ts/components/relayer_index/relayer_top_tokens.tsx | |
parent | 4efd28c092e74b438d0397069c0c55cc90c537f2 (diff) | |
download | dexon-sol-tools-677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6.tar dexon-sol-tools-677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6.tar.gz dexon-sol-tools-677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6.tar.bz2 dexon-sol-tools-677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6.tar.lz dexon-sol-tools-677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6.tar.xz dexon-sol-tools-677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6.tar.zst dexon-sol-tools-677e77d0ae3f0daf9c5c6d43f73a089c24d60ea6.zip |
Add Portal v2 logging
Diffstat (limited to 'packages/website/ts/components/relayer_index/relayer_top_tokens.tsx')
-rw-r--r-- | packages/website/ts/components/relayer_index/relayer_top_tokens.tsx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx b/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx index a5754180b..75335185a 100644 --- a/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx +++ b/packages/website/ts/components/relayer_index/relayer_top_tokens.tsx @@ -1,6 +1,7 @@ -import { colors, EtherscanLinkSuffixes, Styles, utils as sharedUtils } from '@0xproject/react-shared'; +import { colors, constants as sharedConstants, EtherscanLinkSuffixes, Styles, utils as sharedUtils } from '@0xproject/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; +import { analytics } from 'ts/utils/analytics'; import { WebsiteBackendTokenInfo } from 'ts/types'; @@ -61,6 +62,9 @@ class TokenLink extends React.Component<TokenLinkProps, TokenLinkState> { cursor: 'pointer', opacity: this.state.isHovering ? 0.5 : 1, }; + const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId]; + const eventLabel = `${this.props.tokenInfo.symbol}-${networkName}`; + const trackTokenClick = () => analytics.logEvent('Portal', 'Token Click', eventLabel); return ( <a href={tokenLinkFromToken(this.props.tokenInfo, this.props.networkId)} @@ -68,6 +72,7 @@ class TokenLink extends React.Component<TokenLinkProps, TokenLinkState> { style={style} onMouseEnter={this._onToggleHover.bind(this, true)} onMouseLeave={this._onToggleHover.bind(this, false)} + onClick={trackTokenClick} > {this.props.tokenInfo.symbol} </a> |