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 33import { SearchButton as SearchButtonComponent } from "@pythnetwork/component-library/SearchButton" ;
44import DefaultSearchDialog from "fumadocs-ui/components/dialog/search-default" ;
55import { useCallback , useState } from "react" ;
6+ import { createPortal } from "react-dom" ;
67
78export const SearchButton = ( ) => {
89 const [ open , setOpen ] = useState ( false ) ;
@@ -19,11 +20,14 @@ export const SearchButton = () => {
1920 largeScreenContent = "Search"
2021 onClick = { handleSearch }
2122 />
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+ ) }
2731 </ >
2832 ) ;
2933} ;
You can’t perform that action at this time.
0 commit comments