diff options
Diffstat (limited to 'src/screens')
-rw-r--r-- | src/screens/Search/components/ExploreRecommendations.tsx | 8 | ||||
-rw-r--r-- | src/screens/Search/components/ExploreTrendingTopics.tsx | 7 | ||||
-rw-r--r-- | src/screens/Settings/ContentAndMediaSettings.tsx | 11 |
3 files changed, 23 insertions, 3 deletions
diff --git a/src/screens/Search/components/ExploreRecommendations.tsx b/src/screens/Search/components/ExploreRecommendations.tsx index 44ab1770f..7070c44ac 100644 --- a/src/screens/Search/components/ExploreRecommendations.tsx +++ b/src/screens/Search/components/ExploreRecommendations.tsx @@ -1,6 +1,7 @@ import {View} from 'react-native' import {Trans} from '@lingui/macro' +import {logEvent} from '#/lib/statsig/statsig' import {isWeb} from '#/platform/detection' import { DEFAULT_LIMIT as RECOMMENDATIONS_COUNT, @@ -71,7 +72,12 @@ function Inner() { ) : !trending?.suggested ? null : ( <> {trending.suggested.map(topic => ( - <TrendingTopicLink key={topic.link} topic={topic}> + <TrendingTopicLink + key={topic.link} + topic={topic} + onPress={() => { + logEvent('recommendedTopic:click', {context: 'explore'}) + }}> {({hovered}) => ( <TrendingTopic topic={topic} diff --git a/src/screens/Search/components/ExploreTrendingTopics.tsx b/src/screens/Search/components/ExploreTrendingTopics.tsx index ca4fa6e5e..a010ad8dc 100644 --- a/src/screens/Search/components/ExploreTrendingTopics.tsx +++ b/src/screens/Search/components/ExploreTrendingTopics.tsx @@ -106,7 +106,12 @@ function Inner() { ) : !trending?.topics ? null : ( <> {trending.topics.map(topic => ( - <TrendingTopicLink key={topic.link} topic={topic}> + <TrendingTopicLink + key={topic.link} + topic={topic} + onPress={() => { + logEvent('trendingTopic:click', {context: 'explore'}) + }}> {({hovered}) => ( <TrendingTopic topic={topic} diff --git a/src/screens/Settings/ContentAndMediaSettings.tsx b/src/screens/Settings/ContentAndMediaSettings.tsx index bdbe1d191..4a9354bb8 100644 --- a/src/screens/Settings/ContentAndMediaSettings.tsx +++ b/src/screens/Settings/ContentAndMediaSettings.tsx @@ -3,6 +3,7 @@ import {useLingui} from '@lingui/react' import {NativeStackScreenProps} from '@react-navigation/native-stack' import {CommonNavigatorParams} from '#/lib/routes/types' +import {logEvent} from '#/lib/statsig/statsig' import {isNative} from '#/platform/detection' import {useAutoplayDisabled, useSetAutoplayDisabled} from '#/state/preferences' import { @@ -120,7 +121,15 @@ export function ContentAndMediaSettingsScreen({}: Props) { name="show_trending_topics" label={_(msg`Enable trending topics`)} value={!trendingDisabled} - onChange={value => setTrendingDisabled(!value)}> + onChange={value => { + const hide = Boolean(!value) + if (hide) { + logEvent('trendingTopics:hide', {context: 'settings'}) + } else { + logEvent('trendingTopics:show', {context: 'settings'}) + } + setTrendingDisabled(hide) + }}> <SettingsList.Item> <SettingsList.ItemIcon icon={Graph} /> <SettingsList.ItemText> |