File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/frontend/apps/impress/src/features/left-panel/components Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -8,12 +8,14 @@ import { useCreateDoc } from '@/docs/doc-management';
8
8
import { DocSearchModal } from '@/docs/doc-search' ;
9
9
import { useAuth } from '@/features/auth' ;
10
10
import { useCmdK } from '@/hook/useCmdK' ;
11
+ import { useAnalytics } from '@/libs' ;
11
12
12
13
import { useLeftPanelStore } from '../stores' ;
13
14
14
15
export const LeftPanelHeader = ( { children } : PropsWithChildren ) => {
15
16
const router = useRouter ( ) ;
16
17
const { authenticated } = useAuth ( ) ;
18
+ const { trackEvent } = useAnalytics ( ) ;
17
19
const [ isSearchModalOpen , setIsSearchModalOpen ] = useState ( false ) ;
18
20
19
21
const openSearchModal = useCallback ( ( ) => {
@@ -23,8 +25,10 @@ export const LeftPanelHeader = ({ children }: PropsWithChildren) => {
23
25
return ;
24
26
}
25
27
28
+ trackEvent ( { eventName : 'openSearchModal' , position : 'LeftPanelHeader' } ) ;
29
+
26
30
setIsSearchModalOpen ( true ) ;
27
- } , [ ] ) ;
31
+ } , [ trackEvent ] ) ;
28
32
29
33
const closeSearchModal = useCallback ( ( ) => {
30
34
setIsSearchModalOpen ( false ) ;
@@ -46,6 +50,7 @@ export const LeftPanelHeader = ({ children }: PropsWithChildren) => {
46
50
} ;
47
51
48
52
const createNewDoc = ( ) => {
53
+ trackEvent ( { eventName : 'createNewDoc' , position : 'LeftPanelHeader' } ) ;
49
54
createDoc ( ) ;
50
55
} ;
51
56
You can’t perform that action at this time.
0 commit comments