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
+6 -1
View File
@@ -1,5 +1,6 @@
import React from 'react'
import {logEvent} from '#/lib/statsig/statsig'
import * as persisted from '#/state/persisted'
type StateContext = {
@@ -26,7 +27,11 @@ function usePersistedBooleanValue<T extends keyof persisted.Schema>(key: T) {
(value: Exclude<persisted.Schema[T], undefined>) => void
>(
hidden => {
_set(Boolean(hidden))
const hide = Boolean(hidden)
if (!hide) {
logEvent('trendingTopics:show', {})
}
_set(hide)
persisted.write(key, hidden)
},
[key, _set],