Add nav:click event to all main nav items (#10540)
Co-authored-by: Eric Bailey <git@esb.lol>
This commit is contained in:
@@ -30,6 +30,7 @@ import {
|
||||
} from '#/components/Layout/const'
|
||||
import {ScrollbarOffsetContext} from '#/components/Layout/context'
|
||||
import {Text} from '#/components/Typography'
|
||||
import {useAnalytics} from '#/analytics'
|
||||
import {IS_IOS} from '#/env'
|
||||
|
||||
export function Outer({
|
||||
@@ -150,13 +151,15 @@ export function BackButton({onPress, style, ...props}: Partial<ButtonProps>) {
|
||||
|
||||
export function MenuButton() {
|
||||
const {_} = useLingui()
|
||||
const ax = useAnalytics()
|
||||
const setDrawerOpen = useSetDrawerOpen()
|
||||
const {gtMobile} = useBreakpoints()
|
||||
|
||||
const onPress = useCallback(() => {
|
||||
ax.metric('nav:click', {item: 'menu', surface: 'topBar'})
|
||||
Keyboard.dismiss()
|
||||
setDrawerOpen(true)
|
||||
}, [setDrawerOpen])
|
||||
}, [setDrawerOpen, ax])
|
||||
|
||||
return gtMobile ? null : (
|
||||
<Slot>
|
||||
|
||||
Reference in New Issue
Block a user