Add nav:click event to all main nav items (#10540)

Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
Alex Benzer
2026-05-26 07:28:40 -07:00
committed by GitHub
parent 1790fddc78
commit 4e2949c93a
10 changed files with 127 additions and 18 deletions
@@ -14,6 +14,7 @@ import {ButtonIcon} from '#/components/Button'
import {Hashtag_Stroke2_Corner0_Rounded as FeedsIcon} from '#/components/icons/Hashtag'
import * as Layout from '#/components/Layout'
import {Link} from '#/components/Link'
import {useAnalytics} from '#/analytics'
export function HomeHeaderLayout(props: {
children: React.ReactNode
@@ -38,6 +39,7 @@ function HomeHeaderLayoutDesktopAndTablet({
const {headerHeight} = useShellLayout()
const {hasSession} = useSession()
const {_} = useLingui()
const ax = useAnalytics()
const kawaii = useKawaiiMode()
const gutters = useGutters([0, 'base'])
@@ -59,6 +61,9 @@ function HomeHeaderLayoutDesktopAndTablet({
variant="ghost"
color="secondary"
shape="square"
onPress={() => {
ax.metric('nav:click', {item: 'feeds', surface: 'topBar'})
}}
style={[a.justify_center]}>
<ButtonIcon icon={FeedsIcon} size="lg" />
</Link>
@@ -19,6 +19,7 @@ import {ButtonIcon} from '#/components/Button'
import {Hashtag_Stroke2_Corner0_Rounded as FeedsIcon} from '#/components/icons/Hashtag'
import * as Layout from '#/components/Layout'
import {Link} from '#/components/Link'
import {useAnalytics} from '#/analytics'
import {IS_DEV, IS_LIQUID_GLASS} from '#/env'
export function HomeHeaderLayoutMobile({
@@ -29,6 +30,7 @@ export function HomeHeaderLayoutMobile({
}) {
const t = useTheme()
const {_} = useLingui()
const ax = useAnalytics()
const {headerHeight} = useShellLayout()
const insets = useSafeAreaInsets()
const headerMinimalShellTransform = useHomeHeaderTransform()
@@ -84,6 +86,9 @@ export function HomeHeaderLayoutMobile({
variant="ghost"
color="secondary"
shape="square"
onPress={() => {
ax.metric('nav:click', {item: 'feeds', surface: 'topBar'})
}}
style={[
a.justify_center,
{marginRight: -Layout.BUTTON_VISUAL_ALIGNMENT_OFFSET},