docs,api-ref: added search filters (#4830)
* initial implementation of search modal * added hit and search suggestions * added support for multiple indices * updated sample env * added close when click outside dropdown * test for mobile * added mobile design * added shortcut * dark mode fixes * added search to docs * added plugins filter * added React import * moved filters to configurations * handled error on page load * change suggestion text * removed hits limit * handle select all * open link in current tab * change highlight colors * added support for shortcuts + auto focus * change header and footer * redesigned search ui
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
useReducer,
|
||||
useState,
|
||||
} from "react"
|
||||
import { usePageLoading } from "./page-loading"
|
||||
|
||||
export enum SidebarItemSections {
|
||||
TOP = "top",
|
||||
@@ -167,6 +168,7 @@ const SidebarProvider = ({ children }: SidebarProviderProps) => {
|
||||
const [activePath, setActivePath] = useState<string | null>("")
|
||||
const [mobileSidebarOpen, setMobileSidebarOpen] = useState<boolean>(false)
|
||||
const [desktopSidebarOpen, setDesktopSidebarOpen] = useState(true)
|
||||
const { isLoading, setIsLoading } = usePageLoading()
|
||||
|
||||
const findItemInSection = useCallback(
|
||||
(
|
||||
@@ -288,6 +290,12 @@ const SidebarProvider = ({ children }: SidebarProviderProps) => {
|
||||
}
|
||||
}, [handleHashChange])
|
||||
|
||||
useEffect(() => {
|
||||
if (isLoading && items.top.length && items.bottom.length) {
|
||||
setIsLoading(false)
|
||||
}
|
||||
}, [items, isLoading, setIsLoading])
|
||||
|
||||
return (
|
||||
<SidebarContext.Provider
|
||||
value={{
|
||||
|
||||
Reference in New Issue
Block a user