Update events

This commit is contained in:
Eric Bailey
2025-01-17 16:26:21 -06:00
parent 8c9ad15851
commit fa7f422aa2
5 changed files with 19 additions and 11 deletions
+4 -4
View File
@@ -47,7 +47,7 @@ export function VideoPostCard({
/**
* Callback for metrics etc
*/
onInteract: () => void
onInteract?: () => void
}) {
const t = useTheme()
const {_, i18n} = useLingui()
@@ -81,7 +81,7 @@ export function VideoPostCard({
},
}}
onPress={() => {
onInteract()
onInteract?.()
}}
onPressIn={onPressIn}
onPressOut={onPressOut}
@@ -334,7 +334,7 @@ export function CompactVideoPostCard({
/**
* Callback for metrics etc
*/
onInteract: () => void
onInteract?: () => void
}) {
const t = useTheme()
const {_, i18n} = useLingui()
@@ -366,7 +366,7 @@ export function CompactVideoPostCard({
},
}}
onPress={() => {
onInteract()
onInteract?.()
}}
onPressIn={onPressIn}
onPressOut={onPressOut}
@@ -1,6 +1,7 @@
import {View} from 'react-native'
import {AppBskyEmbedVideo} from '@atproto/api'
import {logEvent} from '#/lib/statsig/statsig'
import {FeedPostSliceItem} from '#/state/queries/post-feed'
import {VideoFeedSourceContext} from '#/screens/VideoFeed/types'
import {atoms as a, useGutters} from '#/alf'
@@ -41,6 +42,9 @@ export function PostFeedVideoGridRow({
post={post.post}
sourceContext={sourceContext}
moderation={post.moderation}
onInteract={() => {
logEvent('videoCard:click', {context: 'feed'})
}}
/>
</Grid.Col>
))}
@@ -31,7 +31,7 @@ export function TrendingVideos() {
const onConfirmHide = React.useCallback(() => {
setTrendingVideoDisabled(true)
logEvent('trendingVideos:hide', {context: 'interstitial'})
logEvent('trendingVideos:hide', {context: 'interstitial:discover'})
}, [setTrendingVideoDisabled])
if (error) {
@@ -113,7 +113,9 @@ export function TrendingVideos() {
uri: VIDEO_FEED_URI,
}}
onInteract={() => {
logEvent('trendingVideo:click', {context: 'interstitial'})
logEvent('videoCard:click', {
context: 'interstitial:discover',
})
}}
/>
</View>
+3 -3
View File
@@ -253,10 +253,10 @@ export type LogEvents = {
context: 'settings'
}
'trendingVideos:hide': {
context: 'settings' | 'interstitial' | 'explore'
context: 'settings' | 'interstitial:discover' | 'interstitial:explore'
}
'trendingVideo:click': {
context: 'interstitial' | 'explore'
'videoCard:click': {
context: 'interstitial:discover' | 'interstitial:explore' | 'feed'
}
'progressGuide:hide': {}
@@ -10,7 +10,7 @@ import {isWeb} from '#/platform/detection'
import {useSavedFeeds} from '#/state/queries/feed'
import {usePostFeedQuery} from '#/state/queries/post-feed'
import {useAddSavedFeedsMutation} from '#/state/queries/preferences'
import {atoms as a, tokens,useGutters, useTheme} from '#/alf'
import {atoms as a, tokens, useGutters, useTheme} from '#/alf'
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
import {GradientFill} from '#/components/GradientFill'
import {Pin_Stroke2_Corner0_Rounded as Pin} from '#/components/icons/Pin'
@@ -134,7 +134,9 @@ export function ExploreTrendingVideos() {
uri: VIDEO_FEED_URI,
}}
onInteract={() => {
logEvent('trendingVideo:click', {context: 'interstitial'})
logEvent('videoCard:click', {
context: 'interstitial:explore',
})
}}
/>
</View>