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/onboarding | |
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/onboarding')
-rw-r--r-- | packages/website/ts/components/onboarding/portal_onboarding_flow.tsx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx index bf52684d7..086cddc52 100644 --- a/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx +++ b/packages/website/ts/components/onboarding/portal_onboarding_flow.tsx @@ -1,12 +1,15 @@ +import { constants as sharedConstants } from '@0xproject/react-shared'; import * as _ from 'lodash'; import * as React from 'react'; import { BigNumber } from '@0xproject/utils'; +import { analytics } from 'ts/utils/analytics'; import { OnboardingFlow, Step } from 'ts/components/onboarding/onboarding_flow'; import { ProviderType, TokenByAddress, TokenStateByAddress } from 'ts/types'; import { utils } from 'ts/utils/utils'; export interface PortalOnboardingFlowProps { + networkId: number; stepIndex: number; isRunning: boolean; userAddress: string; @@ -34,8 +37,8 @@ export class PortalOnboardingFlow extends React.Component<PortalOnboardingFlowPr steps={this._getSteps()} stepIndex={this.props.stepIndex} isRunning={this.props.isRunning} - onClose={this.props.updateIsRunning.bind(this, false)} - updateOnboardingStep={this.props.updateOnboardingStep} + onClose={this._closeOnboarding.bind(this)} + updateOnboardingStep={this._updateOnboardingStep.bind(this)} /> ); } @@ -122,7 +125,19 @@ export class PortalOnboardingFlow extends React.Component<PortalOnboardingFlowPr } private _autoStartOnboardingIfShould(): void { if (!this.props.isRunning && !this.props.hasBeenSeen && this.props.blockchainIsLoaded) { + const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId]; + analytics.logEvent('Portal', 'Onboarding Started - Automatic', networkName, this.props.stepIndex); this.props.updateIsRunning(true); } } + private _updateOnboardingStep(stepIndex: number): void { + const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId]; + this.props.updateOnboardingStep(stepIndex); + analytics.logEvent('Portal', 'Update Onboarding Step', networkName, stepIndex); + } + private _closeOnboarding(): void { + const networkName = sharedConstants.NETWORK_NAME_BY_ID[this.props.networkId]; + this.props.updateIsRunning(false); + analytics.logEvent('Portal', 'Onboarding Closed', networkName, this.props.stepIndex); + } } |