Skip to content

Commit

Permalink
chore: add analytics event for view pools press
Browse files Browse the repository at this point in the history
  • Loading branch information
MuckT committed May 13, 2024
1 parent 483b32d commit 03b7636
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/analytics/Events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -682,4 +682,5 @@ export enum EarnEvents {
earn_deposit_terms_and_conditions_press = 'earn_deposit_terms_and_conditions_press',
earn_deposit_complete = 'earn_deposit_complete',
earn_deposit_cancel = 'earn_deposit_cancel',
earn_view_pools_press = 'earn_view_pools_press',
}
1 change: 1 addition & 0 deletions src/analytics/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ interface EarnEventsProperties {
[EarnEvents.earn_deposit_terms_and_conditions_press]: undefined
[EarnEvents.earn_deposit_complete]: undefined
[EarnEvents.earn_deposit_cancel]: undefined
[EarnEvents.earn_view_pools_press]: undefined
}

export type AnalyticsPropertiesList = AppEventsProperties &
Expand Down
1 change: 1 addition & 0 deletions src/analytics/docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,7 @@ export const eventDocs: Record<AnalyticsEventType, string> = {
[EarnEvents.earn_deposit_terms_and_conditions_press]: `When a user taps on the terms and conditions link on the deposit bottom sheet`,
[EarnEvents.earn_deposit_complete]: `When a user taps on the complete button on the deposit bottom sheet`,
[EarnEvents.earn_deposit_cancel]: `When a user taps on the cancel button on the deposit bottom sheet`,
[EarnEvents.earn_view_pools_press]: `When the user taps on the view pools button from token details`,

// Legacy event docs
// The below events had docs, but are no longer produced by the latest app version.
Expand Down
3 changes: 3 additions & 0 deletions src/earn/EarnActivePool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react'
import { useAsync } from 'react-async-hook'
import { useTranslation } from 'react-i18next'
import { StyleSheet, Text, View } from 'react-native'
import { EarnEvents } from 'src/analytics/Events'
import ValoraAnalytics from 'src/analytics/ValoraAnalytics'
import Button, { BtnSizes, BtnTypes } from 'src/components/Button'
import SkeletonPlaceholder from 'src/components/SkeletonPlaceholder'
import TokenDisplay from 'src/components/TokenDisplay'
Expand Down Expand Up @@ -138,6 +140,7 @@ export default function EarnActivePool({ depositTokenId, poolTokenId, cta }: Pro
<View style={styles.buttonContainer}>
<Button
onPress={() => {
ValoraAnalytics.track(EarnEvents.earn_view_pools_press)
navigate(Screens.TabDiscover)

Check warning on line 144 in src/earn/EarnActivePool.tsx

View check run for this annotation

Codecov / codecov/patch

src/earn/EarnActivePool.tsx#L142-L144

Added lines #L142 - L144 were not covered by tests
}}
text={t('earnFlow.activePools.viewPools')}
Expand Down

0 comments on commit 03b7636

Please sign in to comment.