docs: redesigned navigation (#9525)
Redesign navigation bar to reflect new design and allow for dropdowns Closes DX-943
This commit is contained in:
1 parent
7c5415ba3a
commit
49a91fd40e
63 files changed
+934
-978
No files matched your search
@@ -7,5 +7,12 @@ export const config: DocsConfig = {
|
||||
titleSuffix: "Medusa v2 Docs",
|
||||
baseUrl,
|
||||
basePath: process.env.NEXT_PUBLIC_BASE_PATH,
|
||||
sidebar: sidebarConfig(baseUrl),
|
||||
sidebar: sidebarConfig,
|
||||
project: {
|
||||
title: "Documentation",
|
||||
key: "book",
|
||||
},
|
||||
breadcrumbOptions: {
|
||||
showCategories: false,
|
||||
},
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Badge, getMobileSidebarItems } from "docs-ui"
|
||||
import { Badge } from "docs-ui"
|
||||
import type { SidebarConfig, SidebarItem } from "@/types"
|
||||
import { sidebar } from "../sidebar.mjs"
|
||||
|
||||
@@ -20,12 +20,7 @@ const normalizeSidebarItems = (items: SidebarItem[]) =>
|
||||
return item
|
||||
})
|
||||
|
||||
export const sidebarConfig = (baseUrl: string): SidebarConfig => {
|
||||
return {
|
||||
default: normalizeSidebarItems(sidebar),
|
||||
mobile: getMobileSidebarItems({
|
||||
baseUrl,
|
||||
version: "v2",
|
||||
}),
|
||||
}
|
||||
export const sidebarConfig: SidebarConfig = {
|
||||
default: normalizeSidebarItems(sidebar),
|
||||
mobile: [],
|
||||
}
|
||||
@@ -8,7 +8,6 @@ import {
|
||||
} from "docs-ui"
|
||||
import { useMemo } from "react"
|
||||
import { config } from "../config"
|
||||
import { basePathUrl } from "../utils/base-path-url"
|
||||
import { usePathname } from "next/navigation"
|
||||
import { generatedEditDates } from "../generated/edit-dates.mjs"
|
||||
|
||||
@@ -23,8 +22,6 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
() =>
|
||||
getNavDropdownItems({
|
||||
basePath: config.baseUrl,
|
||||
activePath: basePathUrl(),
|
||||
version: "v2",
|
||||
}),
|
||||
[]
|
||||
)
|
||||
@@ -51,9 +48,6 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
|
||||
navItems={navigationDropdownItems}
|
||||
reportIssueLink={reportLink}
|
||||
editDate={editDate}
|
||||
breadcrumbOptions={{
|
||||
showCategories: false,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</UiMainNavProvider>
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
AiAssistantIcon,
|
||||
AiAssistantProvider,
|
||||
SearchProvider as UiSearchProvider,
|
||||
searchFiltersV2,
|
||||
searchFilters,
|
||||
} from "docs-ui"
|
||||
import { config } from "../config"
|
||||
|
||||
@@ -50,7 +50,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
|
||||
checkInternalPattern: new RegExp(
|
||||
`^${config.baseUrl}/v2/([^(resources)])*`
|
||||
),
|
||||
filterOptions: searchFiltersV2,
|
||||
filterOptions: searchFilters,
|
||||
}}
|
||||
commands={[
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user