diff --git a/apps/marketing-astro/src/components/docs/mobileNavSidebar.astro b/apps/marketing-astro/src/components/docs/mobileNavSidebar.astro new file mode 100644 index 00000000..0f320326 --- /dev/null +++ b/apps/marketing-astro/src/components/docs/mobileNavSidebar.astro @@ -0,0 +1,44 @@ +--- +import ChevronDownIcon from "@heroicons/react/24/solid/ChevronDownIcon"; +--- + +
+ + + +
+ + diff --git a/apps/marketing-astro/src/components/docs/navSidebar.astro b/apps/marketing-astro/src/components/docs/navSidebar.astro new file mode 100644 index 00000000..ec1b8d2b --- /dev/null +++ b/apps/marketing-astro/src/components/docs/navSidebar.astro @@ -0,0 +1,51 @@ +--- +import { cx } from "class-variance-authority"; + +interface Props { + sections: { + title: string; + links: { + title: string; + href: string; + }[]; + }[]; + path: string; + mobile?: boolean; +} + +const { sections, path, mobile } = Astro.props; +--- + + diff --git a/apps/marketing-astro/src/pages/docs/[...path].astro b/apps/marketing-astro/src/pages/docs/[...path].astro index f8eb320f..c2132852 100644 --- a/apps/marketing-astro/src/pages/docs/[...path].astro +++ b/apps/marketing-astro/src/pages/docs/[...path].astro @@ -13,6 +13,8 @@ import { PageNavigation } from "./nextPage"; import { ArrowUpRightIcon } from "@heroicons/react/24/solid"; import { cx } from "class-variance-authority"; import "./docs.css"; +import NavSidebar from "../../components/docs/navSidebar.astro"; +import MobileNavSidebar from "../../components/docs/mobileNavSidebar.astro"; export const prerender = true; @@ -68,49 +70,18 @@ const sections = await getFiles(); class="relative mx-auto flex w-full flex-auto justify-center sm:px-2 md:px-8" >
- + + +
+ +
+
diff --git a/apps/marketing-astro/src/pages/docs/docsNav.tsx b/apps/marketing-astro/src/pages/docs/docsNav.tsx new file mode 100644 index 00000000..4d86447f --- /dev/null +++ b/apps/marketing-astro/src/pages/docs/docsNav.tsx @@ -0,0 +1,80 @@ +"use client"; + +import NextLink from "next/link"; +import { cx } from "class-variance-authority"; +import { usePathname } from "next/navigation"; +import * as Collapsible from "@radix-ui/react-collapsible"; +import { ChevronDownIcon } from "@heroicons/react/24/outline"; +import { useState } from "react"; + +export interface Section { + title: string; + links: { + title: string; + href: string; + }[]; +} + +interface DocsNavProps { + sections: Section[]; + mobile?: boolean; + onNav?: () => void; +} + +export function DocsNavDesktop({ sections, mobile, onNav }: DocsNavProps) { + const pathname = usePathname(); + return ( + + ); +} + +export function DocsNavMobile({ sections }: DocsNavProps) { + + + + const [open, setOpen] = useState(false); + + + return ( + + + {" "} + Menu + + + setOpen(false)} mobile sections={sections} /> + + + ); +}