mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-15 14:30:56 -05:00
d0b5c2f307
GitOrigin-RevId: 2f46fe26561bfa2eca36ad605cdd217514aba09d
25 lines
640 B
TypeScript
25 lines
640 B
TypeScript
import { useLayoutContext } from '@/shared/context/layout-context'
|
|
import { useEffect } from 'react'
|
|
import { sendMBOnce } from '@/infrastructure/event-tracking'
|
|
|
|
export function useLayoutEventTracking() {
|
|
const { view, leftMenuShown, chatIsOpen } = useLayoutContext()
|
|
|
|
useEffect(() => {
|
|
if (view && view !== 'editor' && view !== 'pdf') {
|
|
sendMBOnce(`ide-open-view-${view}-once`)
|
|
}
|
|
}, [view])
|
|
|
|
useEffect(() => {
|
|
if (leftMenuShown) {
|
|
sendMBOnce(`ide-open-left-menu-once`)
|
|
}
|
|
}, [leftMenuShown])
|
|
|
|
useEffect(() => {
|
|
if (chatIsOpen) {
|
|
sendMBOnce(`ide-open-chat-once`)
|
|
}
|
|
}, [chatIsOpen])
|
|
}
|