File tree 2 files changed +4
-4
lines changed
components/widgets/shared
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { ClerkProvider } from '@clerk/nextjs'
10
10
import PKG from '~/../package.json'
11
11
import { HydrationEndDetector } from '~/components/common/HydrationEndDetector'
12
12
import { Root } from '~/components/layout/root/Root'
13
+ import { SearchPanelWithHotKey } from '~/components/widgets/shared/SearchFAB'
13
14
import { TocAutoScroll } from '~/components/widgets/toc/TocAutoScroll'
14
15
import { attachUA } from '~/lib/attach-ua'
15
16
import { sansFont , serifFont } from '~/lib/fonts'
@@ -136,6 +137,7 @@ export default async function RootLayout(props: Props) {
136
137
< Root > { children } </ Root >
137
138
138
139
< TocAutoScroll />
140
+ < SearchPanelWithHotKey />
139
141
< Analyze />
140
142
</ Providers >
141
143
< ToastContainer />
Original file line number Diff line number Diff line change @@ -40,13 +40,11 @@ export const SearchFAB = () => {
40
40
>
41
41
< i className = "icon-[mingcute--search-line]" />
42
42
</ FABPortable >
43
- < WithHotKey />
44
- < SearchPanel />
45
43
</ >
46
44
)
47
45
}
48
46
49
- const WithHotKey = ( ) => {
47
+ export const SearchPanelWithHotKey = ( ) => {
50
48
useEffect ( ( ) => {
51
49
const handler = ( e : KeyboardEvent ) => {
52
50
if ( e . key === 'k' && e . metaKey ) {
@@ -68,7 +66,7 @@ const WithHotKey = () => {
68
66
document . removeEventListener ( 'keydown' , handler )
69
67
}
70
68
} , [ ] )
71
- return null
69
+ return < SearchPanel />
72
70
}
73
71
74
72
const SearchPanel = ( ) => {
You can’t perform that action at this time.
0 commit comments