File tree Expand file tree Collapse file tree 2 files changed +6
-20
lines changed
custom-implementation/src Expand file tree Collapse file tree 2 files changed +6
-20
lines changed Original file line number Diff line number Diff line change 1
- import { useEffect , useState } from 'react'
2
-
3
1
export const Search = ( ) => {
4
- const isMac =
5
- typeof window !== 'undefined'
6
- ? navigator . userAgent . toUpperCase ( ) . indexOf ( 'MAC' ) >= 0
7
- : false
8
-
9
- const [ isClient , setIsClient ] = useState < any > ( false )
10
- useEffect ( ( ) => {
11
- setIsClient ( true )
12
- } , [ ] )
13
-
14
2
return (
15
3
< button
16
4
id = "fern-search-button"
@@ -43,9 +31,7 @@ export const Search = () => {
43
31
</ svg >
44
32
< span > Search...</ span >
45
33
</ span >
46
- < kbd className = "keyboard-shortcut-hint" >
47
- { ! isMac && isClient ? 'CTRL' : 'CMD' } + +
48
- </ kbd >
34
+ < kbd className = "keyboard-shortcut-hint" > /</ kbd >
49
35
</ button >
50
36
)
51
37
}
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import React from 'react'
8
8
import Header from './components/header'
9
9
import Footer from './components/footer'
10
10
import { ThemeSwitch } from './components/theme-switch'
11
- // import { Search } from './components/search'
11
+ import { Search } from './components/search'
12
12
13
13
import { getPageData } from './modules/sanity/utils'
14
14
@@ -35,10 +35,10 @@ const render = async () => {
35
35
sidenav . appendChild ( wrapper )
36
36
ReactDOM . render ( React . createElement ( ThemeSwitch ) , wrapper )
37
37
38
- // const search = document.createElement('div')
39
- // search.setAttribute('id', 'search-component')
40
- // sidenav.appendChild(search)
41
- // ReactDOM.render(React.createElement(Search), search)
38
+ const search = document . createElement ( 'div' )
39
+ search . setAttribute ( 'id' , 'search-component' )
40
+ sidenav . appendChild ( search )
41
+ ReactDOM . render ( React . createElement ( Search ) , search )
42
42
}
43
43
44
44
const fernHeaderId = document . getElementById ( FERN_CONTENT_WRAPPER_ID )
You can’t perform that action at this time.
0 commit comments