Add click metric to cards

This commit is contained in:
Eric Bailey
2024-07-01 12:45:19 -05:00
parent a0b7042269
commit 79a308fdf7
2 changed files with 16 additions and 2 deletions
+13 -2
View File
@@ -7,6 +7,7 @@ import {useLingui} from '@lingui/react'
import {useNavigation} from '@react-navigation/native' import {useNavigation} from '@react-navigation/native'
import {NavigationProp} from '#/lib/routes/types' import {NavigationProp} from '#/lib/routes/types'
import {logEvent} from '#/lib/statsig/statsig'
import {useModerationOpts} from '#/state/preferences/moderation-opts' import {useModerationOpts} from '#/state/preferences/moderation-opts'
import {useGetPopularFeedsQuery} from '#/state/queries/feed' import {useGetPopularFeedsQuery} from '#/state/queries/feed'
import {useSuggestedFollowsQuery} from '#/state/queries/suggested-follows' import {useSuggestedFollowsQuery} from '#/state/queries/suggested-follows'
@@ -109,7 +110,12 @@ export function SuggestedFollows() {
) : error || !profiles.length ? null : ( ) : error || !profiles.length ? null : (
<> <>
{profiles.slice(0, maxLength).map(profile => ( {profiles.slice(0, maxLength).map(profile => (
<ProfileCard.Link key={profile.did} did={profile.handle}> <ProfileCard.Link
key={profile.did}
did={profile.handle}
onPress={() => {
logEvent('feed:interstitial:profileCard:press', {})
}}>
{({hovered, pressed}) => ( {({hovered, pressed}) => (
<CardOuter <CardOuter
style={[ style={[
@@ -236,7 +242,12 @@ export function SuggestedFeeds() {
) : error || !feeds ? null : ( ) : error || !feeds ? null : (
<> <>
{feeds.slice(0, numFeedsToDisplay).map(feed => ( {feeds.slice(0, numFeedsToDisplay).map(feed => (
<FeedCard.Link key={feed.uri} view={feed}> <FeedCard.Link
key={feed.uri}
view={feed}
onPress={() => {
logEvent('feed:interstitial:feedCard:press', {})
}}>
{({hovered, pressed}) => ( {({hovered, pressed}) => (
<CardOuter <CardOuter
style={[ style={[
+3
View File
@@ -197,6 +197,9 @@ export type LogEvents = {
starterPack: string starterPack: string
} }
'feed:interstitial:profileCard:press': {}
'feed:interstitial:feedCard:press': {}
'test:all:always': {} 'test:all:always': {}
'test:all:sometimes': {} 'test:all:sometimes': {}
'test:all:boosted_by_gate1': {reason: 'base' | 'gate1'} 'test:all:boosted_by_gate1': {reason: 'base' | 'gate1'}