docs: redesigned navigation (#9525)
Redesign navigation bar to reflect new design and allow for dropdowns Closes DX-943
This commit is contained in:
@@ -34,6 +34,7 @@ export default function RootLayout({
|
||||
bodyClassName={clsx(inter.variable, robotoMono.variable)}
|
||||
showToc={false}
|
||||
showBanner={false}
|
||||
showBreadcrumbs={false}
|
||||
>
|
||||
{children}
|
||||
</WideLayout>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { DocsConfig } from "types"
|
||||
import { getMobileSidebarItems } from "docs-ui"
|
||||
|
||||
const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000"
|
||||
|
||||
@@ -16,9 +15,10 @@ export const config: DocsConfig = {
|
||||
loaded: true,
|
||||
},
|
||||
],
|
||||
mobile: getMobileSidebarItems({
|
||||
baseUrl,
|
||||
version: "v2",
|
||||
}),
|
||||
mobile: [],
|
||||
},
|
||||
project: {
|
||||
title: "API Reference",
|
||||
key: "api-reference",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -8,8 +8,6 @@ import {
|
||||
} from "docs-ui"
|
||||
import { useMemo } from "react"
|
||||
import { config } from "../config"
|
||||
import { usePathname } from "next/navigation"
|
||||
import basePathUrl from "../utils/base-path-url"
|
||||
|
||||
type MainNavProviderProps = {
|
||||
children?: React.ReactNode
|
||||
@@ -17,15 +15,12 @@ type MainNavProviderProps = {
|
||||
|
||||
export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
const { isBrowser } = useIsBrowser()
|
||||
const pathname = usePathname()
|
||||
const navigationDropdownItems = useMemo(
|
||||
() =>
|
||||
getNavDropdownItems({
|
||||
basePath: config.baseUrl,
|
||||
activePath: basePathUrl(pathname),
|
||||
version: "v2",
|
||||
}),
|
||||
[pathname]
|
||||
[]
|
||||
)
|
||||
|
||||
const reportLink = useMemo(
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import {
|
||||
usePageLoading,
|
||||
SearchProvider as UiSearchProvider,
|
||||
searchFiltersV2,
|
||||
searchFilters,
|
||||
AiAssistantIcon,
|
||||
AiAssistantProvider,
|
||||
} from "docs-ui"
|
||||
@@ -51,7 +51,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
|
||||
checkInternalPattern: new RegExp(
|
||||
`^${config.baseUrl}${basePathUrl(`/(admin|store)`)}`
|
||||
),
|
||||
filterOptions: searchFiltersV2,
|
||||
filterOptions: searchFilters,
|
||||
}}
|
||||
commands={[
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user