Add hide events to each location
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
|
import React from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {logEvent} from '#/lib/statsig/statsig'
|
||||||
import {
|
import {
|
||||||
useTrendingSettings,
|
useTrendingSettings,
|
||||||
useTrendingSettingsApi,
|
useTrendingSettingsApi,
|
||||||
@@ -39,6 +41,11 @@ export function Inner() {
|
|||||||
const {data: trending, error, isLoading} = useTrendingTopics()
|
const {data: trending, error, isLoading} = useTrendingTopics()
|
||||||
const noTopics = !isLoading && !error && !trending?.topics?.length
|
const noTopics = !isLoading && !error && !trending?.topics?.length
|
||||||
|
|
||||||
|
const onConfirmHide = React.useCallback(() => {
|
||||||
|
logEvent('trendingTopics:hide', {context: 'interstitial'})
|
||||||
|
setTrendingDisabled(true)
|
||||||
|
}, [setTrendingDisabled])
|
||||||
|
|
||||||
return error || noTopics ? null : (
|
return error || noTopics ? null : (
|
||||||
<View
|
<View
|
||||||
style={[
|
style={[
|
||||||
@@ -104,7 +111,7 @@ export function Inner() {
|
|||||||
title={_(msg`Hide trending topics?`)}
|
title={_(msg`Hide trending topics?`)}
|
||||||
description={_(msg`You can update this later from your settings.`)}
|
description={_(msg`You can update this later from your settings.`)}
|
||||||
confirmButtonCta={_(msg`Hide`)}
|
confirmButtonCta={_(msg`Hide`)}
|
||||||
onConfirm={() => setTrendingDisabled(true)}
|
onConfirm={onConfirmHide}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -239,6 +239,6 @@ export type LogEvents = {
|
|||||||
|
|
||||||
'trendingTopics:show': {}
|
'trendingTopics:show': {}
|
||||||
'trendingTopics:hide': {
|
'trendingTopics:hide': {
|
||||||
context: 'sidebar' | 'discover' | 'explore'
|
context: 'sidebar' | 'interstitial' | 'explore'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
import React from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {msg,Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {logEvent} from '#/lib/statsig/statsig'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import {
|
import {
|
||||||
useTrendingSettings,
|
useTrendingSettings,
|
||||||
@@ -40,6 +42,11 @@ function Inner() {
|
|||||||
const {setTrendingDisabled} = useTrendingSettingsApi()
|
const {setTrendingDisabled} = useTrendingSettingsApi()
|
||||||
const trendingPrompt = Prompt.usePromptControl()
|
const trendingPrompt = Prompt.usePromptControl()
|
||||||
|
|
||||||
|
const onConfirmHide = React.useCallback(() => {
|
||||||
|
logEvent('trendingTopics:hide', {context: 'explore'})
|
||||||
|
setTrendingDisabled(true)
|
||||||
|
}, [setTrendingDisabled])
|
||||||
|
|
||||||
return error || noTopics ? null : (
|
return error || noTopics ? null : (
|
||||||
<>
|
<>
|
||||||
<View
|
<View
|
||||||
@@ -123,7 +130,7 @@ function Inner() {
|
|||||||
title={_(msg`Hide trending topics?`)}
|
title={_(msg`Hide trending topics?`)}
|
||||||
description={_(msg`You can update this later from your settings.`)}
|
description={_(msg`You can update this later from your settings.`)}
|
||||||
confirmButtonCta={_(msg`Hide`)}
|
confirmButtonCta={_(msg`Hide`)}
|
||||||
onConfirm={() => setTrendingDisabled(true)}
|
onConfirm={onConfirmHide}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
|
import React from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
|
import {logEvent} from '#/lib/statsig/statsig'
|
||||||
import {
|
import {
|
||||||
useTrendingSettings,
|
useTrendingSettings,
|
||||||
useTrendingSettingsApi,
|
useTrendingSettingsApi,
|
||||||
@@ -37,6 +39,11 @@ function Inner() {
|
|||||||
const {data: trending, error, isLoading} = useTrendingTopics()
|
const {data: trending, error, isLoading} = useTrendingTopics()
|
||||||
const noTopics = !isLoading && !error && !trending?.topics?.length
|
const noTopics = !isLoading && !error && !trending?.topics?.length
|
||||||
|
|
||||||
|
const onConfirmHide = React.useCallback(() => {
|
||||||
|
logEvent('trendingTopics:hide', {context: 'sidebar'})
|
||||||
|
setTrendingDisabled(true)
|
||||||
|
}, [setTrendingDisabled])
|
||||||
|
|
||||||
return error || noTopics ? null : (
|
return error || noTopics ? null : (
|
||||||
<>
|
<>
|
||||||
<View style={[a.gap_sm, {paddingBottom: 2}]}>
|
<View style={[a.gap_sm, {paddingBottom: 2}]}>
|
||||||
@@ -96,7 +103,7 @@ function Inner() {
|
|||||||
title={_(msg`Hide trending topics?`)}
|
title={_(msg`Hide trending topics?`)}
|
||||||
description={_(msg`You can update this later from your settings.`)}
|
description={_(msg`You can update this later from your settings.`)}
|
||||||
confirmButtonCta={_(msg`Hide`)}
|
confirmButtonCta={_(msg`Hide`)}
|
||||||
onConfirm={() => setTrendingDisabled(true)}
|
onConfirm={onConfirmHide}
|
||||||
/>
|
/>
|
||||||
<Divider />
|
<Divider />
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user