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
2024-10-11 07:10:00 +00:00
committed by GitHub
parent 7c5415ba3a
commit 49a91fd40e
63 changed files with 934 additions and 978 deletions
+1 -6
View File
@@ -1,6 +1,4 @@
import { getMobileSidebarItems } from "docs-ui"
import { SidebarSectionItems } from "types"
import { siteConfig } from "./site"
type DocsConfig = {
sidebar: SidebarSectionItems
@@ -359,9 +357,6 @@ export const docsConfig: DocsConfig = {
],
},
],
mobile: getMobileSidebarItems({
baseUrl: siteConfig.baseUrl,
version: "v1",
}),
mobile: [],
},
}
+7
View File
@@ -19,4 +19,11 @@ export const siteConfig: SiteConfig = {
default: [],
mobile: [],
},
project: {
title: "Medusa UI",
key: "ui",
},
breadcrumbOptions: {
showCategories: true,
},
}
-3
View File
@@ -8,7 +8,6 @@ import {
} from "docs-ui"
import { useMemo } from "react"
import { siteConfig } from "../config/site"
import { basePathUrl } from "../lib/base-path-url"
type MainNavProviderProps = {
children?: React.ReactNode
@@ -20,8 +19,6 @@ export const MainNavProvider = ({ children }: MainNavProviderProps) => {
() =>
getNavDropdownItems({
basePath: siteConfig.baseUrl,
activePath: basePathUrl(),
version: "v1",
}),
[]
)
+2 -2
View File
@@ -4,7 +4,7 @@ import {
AiAssistantIcon,
AiAssistantProvider,
SearchProvider as UiSearchProvider,
searchFiltersV1,
searchFilters,
} from "docs-ui"
import { absoluteUrl } from "../lib/absolute-url"
@@ -34,7 +34,7 @@ const SearchProvider = ({ children }: SearchProviderProps) => {
},
],
checkInternalPattern: new RegExp(`^${absoluteUrl()}/ui`),
filterOptions: searchFiltersV1,
filterOptions: searchFilters,
}}
initialDefaultFilters={["ui"]}
commands={[
+6
View File
@@ -30,6 +30,12 @@
@apply text-ui-fg-subtle;
}
/* Hack to hide navbar / toc when some components like prompt are opened. */
body[data-scroll-locked] .z-20,
body[data-scroll-locked] .z-10 {
z-index: 0 !important;
}
body[data-modal="opened"] {
@apply !overflow-hidden text-ui-fg-base;
}