File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
apps/developer-hub/src/components Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change 3
3
import { SearchButton as SearchButtonComponent } from "@pythnetwork/component-library/SearchButton" ;
4
4
import DefaultSearchDialog from "fumadocs-ui/components/dialog/search-default" ;
5
5
import { useCallback , useState } from "react" ;
6
+ import { createPortal } from "react-dom" ;
6
7
7
8
export const SearchButton = ( ) => {
8
9
const [ open , setOpen ] = useState ( false ) ;
@@ -19,11 +20,14 @@ export const SearchButton = () => {
19
20
largeScreenContent = "Search"
20
21
onClick = { handleSearch }
21
22
/>
22
- < DefaultSearchDialog
23
- open = { open }
24
- onOpenChange = { setOpen }
25
- api = "/api/search"
26
- />
23
+ { open && createPortal (
24
+ < DefaultSearchDialog
25
+ open = { open }
26
+ onOpenChange = { setOpen }
27
+ api = "/api/search"
28
+ /> ,
29
+ document . body
30
+ ) }
27
31
</ >
28
32
) ;
29
33
} ;
You can’t perform that action at this time.
0 commit comments