Files
medusa-store/www/apps/api-reference/components/Navbar/index.tsx
Shahed Nasser 728c5ee53c docs: preparations for preview (#7267)
* configured base paths + added development banner

* fix typelist site url

* added navbar and sidebar badges

* configure algolia filters

* remove AI assistant

* remove unused imports

* change navbar text and badge

* lint fixes

* fix build error

* add to api reference rewrites

* fix build error

* fix build errors in user-guide

* fix feedback component

* add parent title to pagination

* added breadcrumbs component

* remove user-guide links

* resolve todos

* fix details about authentication

* change documentation title

* lint content
2024-05-13 11:32:52 +03:00

53 lines
1.2 KiB
TypeScript

"use client"
import {
Navbar as UiNavbar,
getNavbarItems,
usePageLoading,
useSidebar,
} from "docs-ui"
import FeedbackModal from "./FeedbackModal"
import { useMemo } from "react"
import { config } from "../../config"
import { usePathname } from "next/navigation"
import VersionSwitcher from "../VersionSwitcher"
import { useVersion } from "../../providers/version"
const Navbar = () => {
const { setMobileSidebarOpen, mobileSidebarOpen } = useSidebar()
const pathname = usePathname()
const { isLoading } = usePageLoading()
const { isVersioningEnabled } = useVersion()
const navbarItems = useMemo(
() =>
getNavbarItems({
basePath: config.baseUrl,
activePath: pathname,
version: process.env.NEXT_PUBLIC_SHOW_V2 ? "v1" : "legacy",
}),
[pathname]
)
return (
<UiNavbar
logo={{
light: "/images/logo-icon.png",
dark: "/images/logo-icon-dark.png",
}}
items={navbarItems}
mobileMenuButton={{
setMobileSidebarOpen,
mobileSidebarOpen,
}}
additionalActionsBefore={
<>{isVersioningEnabled && <VersionSwitcher />}</>
}
additionalActionsAfter={<FeedbackModal />}
isLoading={isLoading}
/>
)
}
export default Navbar