Shanmughapriyan S
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
3 additions and
5 deletions
-
beta/src/components/Search.tsx
|
|
@ -99,7 +99,6 @@ export const Search: React.FC<SearchProps> = ({ |
|
|
|
hitsPerPage: 5, |
|
|
|
}, |
|
|
|
}) => { |
|
|
|
const [isLoaded] = React.useState(true); |
|
|
|
const [isShowing, setIsShowing] = React.useState(false); |
|
|
|
|
|
|
|
const importDocSearchModalIfNeeded = React.useCallback( |
|
|
@ -109,8 +108,8 @@ export const Search: React.FC<SearchProps> = ({ |
|
|
|
} |
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
return Promise.all([import('@docsearch/react/modal')]).then( |
|
|
|
([{DocSearchModal: Modal}]) => { |
|
|
|
return import('@docsearch/react/modal').then( |
|
|
|
({DocSearchModal: Modal}) => { |
|
|
|
DocSearchModal = Modal; |
|
|
|
} |
|
|
|
); |
|
|
@ -165,8 +164,7 @@ export const Search: React.FC<SearchProps> = ({ |
|
|
|
</span> |
|
|
|
</button> |
|
|
|
|
|
|
|
{isLoaded && |
|
|
|
isShowing && |
|
|
|
{isShowing && |
|
|
|
createPortal( |
|
|
|
<DocSearchModal |
|
|
|
{...options} |
|
|
|