Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update nav items #9709

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
} from "@medusajs/icons"
import React, { useMemo, useRef, useState } from "react"
import {
BookIcon,
Button,
getOsShortcut,
Menu,
Expand Down Expand Up @@ -35,7 +36,13 @@ export const MainNavDesktopMenu = () => {
type: "link",
icon: <HouseIcon />,
title: "Homepage",
link: "https://docs.medusajs.com/v2",
link: "https://medusajs.com",
},
{
type: "link",
icon: <BookIcon />,
title: "Medusa v1",
link: "https://docs.medusajs.com",
},
{
type: "link",
Expand Down
13 changes: 9 additions & 4 deletions www/packages/docs-ui/src/components/MainNav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import {
SearchModalOpener,
useMainNav,
useSidebar,
useSiteConfig,
} from "../.."
import { MainNavEditDate } from "./EditDate"
import { MainNavItems } from "./Items"
import { MedusaIcon } from "../Icons/MedusaLogo"
import { MainNavDesktopMenu } from "./DesktopMenu"
import { SidebarLeftIcon } from "../Icons/SidebarLeft"
import { MainNavMobileMenu } from "./MobileMenu"
import Link from "next/link"

type MainNavProps = {
className?: string
Expand All @@ -25,6 +27,7 @@ type MainNavProps = {
export const MainNav = ({ className, itemsClassName }: MainNavProps) => {
const { reportIssueLink, editDate } = useMainNav()
const { setMobileSidebarOpen, isSidebarShown } = useSidebar()
const { config } = useSiteConfig()

return (
<div
Expand All @@ -46,10 +49,12 @@ export const MainNav = ({ className, itemsClassName }: MainNavProps) => {
<SidebarLeftIcon />
</Button>
)}
<BorderedIcon
IconComponent={MedusaIcon}
iconWrapperClassName="my-[14px]"
/>
<Link href={`${config.baseUrl}/v2`}>
<BorderedIcon
IconComponent={MedusaIcon}
iconWrapperClassName="my-[14px]"
/>
</Link>
</div>
<MainNavItems className={itemsClassName} />
</div>
Expand Down
84 changes: 79 additions & 5 deletions www/packages/docs-ui/src/constants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,6 @@ export const navDropdownItems: NavigationItem[] = [
{
type: "divider",
},
{
type: "link",
title: "UI Library",
link: "/ui",
},
{
type: "link",
title: "Admin Components",
Expand All @@ -65,6 +60,11 @@ export const navDropdownItems: NavigationItem[] = [
title: "Storefront Development",
link: "/v2/resources/storefront-development",
},
{
type: "link",
title: "UI Library",
link: "/ui",
},
],
},
{
Expand Down Expand Up @@ -96,6 +96,65 @@ export const navDropdownItems: NavigationItem[] = [
},
],
},
{
type: "dropdown",
title: "Framework",
children: [
{
type: "link",
title: "API Routes",
link: "/v2/learn/basics/api-routes",
},
{
type: "link",
title: "Modules",
link: "/v2/learn/basics/modules",
},
{
type: "link",
title: "Subscribers",
link: "/v2/learn/basics/events-and-subscribers",
},
{
type: "link",
title: "Scheduled Jobs",
link: "/v2/learn/basics/scheduled-jobs",
},
{
type: "link",
title: "Loaders",
link: "/v2/learn/basics/loaders",
},
{
type: "link",
title: "Admin Customizations",
link: "/v2/learn/basics/admin-customizations",
},
{
type: "divider",
},
{
type: "link",
title: "Links",
link: "/v2/learn/advanced-development/module-links",
},
{
type: "link",
title: "Query",
link: "/v2/learn/advanced-development/module-links/query",
},
{
type: "link",
title: "Data Models",
link: "/v2/learn/advanced-development/data-models",
},
{
type: "link",
title: "Workflows",
link: "/v2/learn/basics/workflows",
},
],
},
{
type: "dropdown",
title: "Reference",
Expand Down Expand Up @@ -123,6 +182,21 @@ export const navDropdownItems: NavigationItem[] = [
title: "Data Model API",
link: "/v2/resources/references/data-model",
},
{
type: "link",
title: "Service Factory",
link: "/v2/resources/service-factory-reference",
},
{
type: "link",
title: "Events Reference",
link: "/v2/resources/events-reference",
},
{
type: "link",
title: "Admin Widget Injection Zones",
link: "/v2/resources/admin-widget-injection-zones",
},
],
},
]
Expand Down
Loading