Trending tracking (#7161)

* Add hide to Explore

* Event for show

* Add hide events to each location
This commit is contained in:
Eric Bailey
2024-12-18 13:37:46 -06:00
committed by GitHub
parent 05c43ed998
commit e7b015f53f
5 changed files with 64 additions and 5 deletions
+8 -1
View File
@@ -1,7 +1,9 @@
import React from 'react'
import {View} from 'react-native'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'
import {logEvent} from '#/lib/statsig/statsig'
import {
useTrendingSettings,
useTrendingSettingsApi,
@@ -39,6 +41,11 @@ export function Inner() {
const {data: trending, error, isLoading} = useTrendingTopics()
const noTopics = !isLoading && !error && !trending?.topics?.length
const onConfirmHide = React.useCallback(() => {
logEvent('trendingTopics:hide', {context: 'interstitial'})
setTrendingDisabled(true)
}, [setTrendingDisabled])
return error || noTopics ? null : (
<View
style={[
@@ -104,7 +111,7 @@ export function Inner() {
title={_(msg`Hide trending topics?`)}
description={_(msg`You can update this later from your settings.`)}
confirmButtonCta={_(msg`Hide`)}
onConfirm={() => setTrendingDisabled(true)}
onConfirm={onConfirmHide}
/>
</View>
)