aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-27 07:04:02 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-27 07:04:02 +0800
commitae570dba05cfc0d696c616d05804152791d29677 (patch)
tree3b94352af39dd42de038663167e90d9eca441803 /packages/instant/src/components
parent9206f2d288f33367877d2d557d50f1d485d4b92e (diff)
downloaddexon-sol-tools-ae570dba05cfc0d696c616d05804152791d29677.tar.gz
dexon-sol-tools-ae570dba05cfc0d696c616d05804152791d29677.tar.zst
dexon-sol-tools-ae570dba05cfc0d696c616d05804152791d29677.zip
feat(instant): Event tracking for token selector
Diffstat (limited to 'packages/instant/src/components')
-rw-r--r--packages/instant/src/components/zero_ex_instant_container.tsx17
1 files changed, 12 insertions, 5 deletions
diff --git a/packages/instant/src/components/zero_ex_instant_container.tsx b/packages/instant/src/components/zero_ex_instant_container.tsx
index f30bda6ed..b72493ce6 100644
--- a/packages/instant/src/components/zero_ex_instant_container.tsx
+++ b/packages/instant/src/components/zero_ex_instant_container.tsx
@@ -12,7 +12,7 @@ import { SelectedAssetInstantHeading } from '../containers/selected_asset_instan
import { ColorOption } from '../style/theme';
import { zIndex } from '../style/z_index';
import { OrderProcessState, SlideAnimationState } from '../types';
-import { analytics } from '../util/analytics';
+import { analytics, TokenSelectorClosedVia } from '../util/analytics';
import { CSSReset } from './css_reset';
import { SlidingPanel } from './sliding_panel';
@@ -30,6 +30,13 @@ export class ZeroExInstantContainer extends React.Component<{}, ZeroExInstantCon
public state = {
tokenSelectionPanelAnimationState: 'none' as SlideAnimationState,
};
+ private _handlePanelCloseClickedX: () => void;
+ private _handlePanelCloseAfterChose: () => void;
+ public constructor(props: {}) {
+ super(props);
+ this._handlePanelCloseClickedX = this._handlePanelClose.bind(this, TokenSelectorClosedVia.ClickedX);
+ this._handlePanelCloseAfterChose = this._handlePanelClose.bind(this, TokenSelectorClosedVia.TokenChose);
+ }
public render(): React.ReactNode {
return (
<React.Fragment>
@@ -61,9 +68,9 @@ export class ZeroExInstantContainer extends React.Component<{}, ZeroExInstantCon
</Flex>
<SlidingPanel
animationState={this.state.tokenSelectionPanelAnimationState}
- onClose={this._handlePanelClose}
+ onClose={this._handlePanelCloseClickedX}
>
- <AvailableERC20TokenSelector onTokenSelect={this._handlePanelClose} />
+ <AvailableERC20TokenSelector onTokenSelect={this._handlePanelCloseAfterChose} />
</SlidingPanel>
<CurrentStandardSlidingPanel />
</Container>
@@ -88,8 +95,8 @@ export class ZeroExInstantContainer extends React.Component<{}, ZeroExInstantCon
tokenSelectionPanelAnimationState: 'slidIn',
});
};
- private readonly _handlePanelClose = (): void => {
- analytics.trackTokenSelectorClosed();
+ private readonly _handlePanelClose = (closedVia: TokenSelectorClosedVia): void => {
+ analytics.trackTokenSelectorClosed(closedVia);
this.setState({
tokenSelectionPanelAnimationState: 'slidOut',
});