docs: redesigned navigation (#9525)

Redesign navigation bar to reflect new design and allow for dropdowns

Closes DX-943
This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-10-11 07:10:00 +00:00
1 parent 7c5415ba3a
commit 49a91fd40e
63 files changed
+934 -978

No files matched your search

+8 -1
View File
@@ -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,
},
}
+4 -9
View File
@@ -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: [],
}
-6
View File
@@ -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>
+2 -2
View File
@@ -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={[
{