aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-27 05:26:29 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-27 05:27:40 +0800
commit9206f2d288f33367877d2d557d50f1d485d4b92e (patch)
tree393661927c961ea5b4f9d69718c31c2c4d49ad17 /packages/instant/src
parent2fec7613c408a046c130f4c5817696ab3b5e3928 (diff)
downloaddexon-sol-tools-9206f2d288f33367877d2d557d50f1d485d4b92e.tar
dexon-sol-tools-9206f2d288f33367877d2d557d50f1d485d4b92e.tar.gz
dexon-sol-tools-9206f2d288f33367877d2d557d50f1d485d4b92e.tar.bz2
dexon-sol-tools-9206f2d288f33367877d2d557d50f1d485d4b92e.tar.lz
dexon-sol-tools-9206f2d288f33367877d2d557d50f1d485d4b92e.tar.xz
dexon-sol-tools-9206f2d288f33367877d2d557d50f1d485d4b92e.tar.zst
dexon-sol-tools-9206f2d288f33367877d2d557d50f1d485d4b92e.zip
Token selector searched
Diffstat (limited to 'packages/instant/src')
-rw-r--r--packages/instant/src/components/erc20_token_selector.tsx2
-rw-r--r--packages/instant/src/util/analytics.ts3
2 files changed, 5 insertions, 0 deletions
diff --git a/packages/instant/src/components/erc20_token_selector.tsx b/packages/instant/src/components/erc20_token_selector.tsx
index 1b1921acb..0a3d4427a 100644
--- a/packages/instant/src/components/erc20_token_selector.tsx
+++ b/packages/instant/src/components/erc20_token_selector.tsx
@@ -3,6 +3,7 @@ import * as React from 'react';
import { ColorOption } from '../style/theme';
import { ERC20Asset } from '../types';
+import { analytics } from '../util/analytics';
import { assetUtils } from '../util/asset';
import { SearchInput } from './search_input';
@@ -57,6 +58,7 @@ export class ERC20TokenSelector extends React.Component<ERC20TokenSelectorProps>
this.setState({
searchQuery,
});
+ analytics.trackTokenSelectorSearched(searchQuery);
};
private readonly _isTokenQueryMatch = (token: ERC20Asset): boolean => {
const { searchQuery } = this.state;
diff --git a/packages/instant/src/util/analytics.ts b/packages/instant/src/util/analytics.ts
index 50bab174f..cd1074cba 100644
--- a/packages/instant/src/util/analytics.ts
+++ b/packages/instant/src/util/analytics.ts
@@ -21,6 +21,7 @@ enum EventNames {
TOKEN_SELECTOR_OPENED = 'Token Selector - Opened',
TOKEN_SELECTOR_CLOSED = 'Token Selector - Closed',
TOKEN_SELECTOR_CHOSE = 'Token Selector - Chose',
+ TOKEN_SELECTOR_SEARCHED = 'Token Selector - Searched',
}
const track = (eventName: EventNames, eventProperties: EventProperties = {}): void => {
evaluateIfEnabled(() => {
@@ -74,4 +75,6 @@ export const analytics = {
trackTokenSelectorClosed: trackingEventFnWithoutPayload(EventNames.TOKEN_SELECTOR_CLOSED),
trackTokenSelectorChose: (payload: { assetName: string; assetData: string }) =>
trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_CHOSE)(payload),
+ trackTokenSelectorSearched: (searchText: string) =>
+ trackingEventFnWithPayload(EventNames.TOKEN_SELECTOR_SEARCHED)({ searchText }),
};