diff --git a/apps/web/mdx-components.tsx b/apps/web/mdx-components.tsx index 60948ed..2096adb 100644 --- a/apps/web/mdx-components.tsx +++ b/apps/web/mdx-components.tsx @@ -4,32 +4,32 @@ import Link from "next/link"; export function useMDXComponents(components: MDXComponents): MDXComponents { return { h1: ({ children, ...props }) => ( -
+
{children}
), ul: ({ children, ...props }) => ( -
+
{children}
),
pre: ({ children, ...props }) => (
-
+
{children}
),
@@ -69,8 +69,8 @@ export function useMDXComponents(components: MDXComponents): MDXComponents {
);
},
table: ({ children, ...props }) => (
-
-
+
+
{children}
diff --git a/apps/web/src/app/docs/layout.tsx b/apps/web/src/app/docs/layout.tsx
index f5ff5e9..dec3d46 100644
--- a/apps/web/src/app/docs/layout.tsx
+++ b/apps/web/src/app/docs/layout.tsx
@@ -1,24 +1,56 @@
import { DocsSidebar } from "@/components/docs/sidebar";
+import { DocsMobileNav } from "@/components/docs/mobile-nav";
import { ThemeToggle } from "@/components/theme-toggle";
import { BrandLogo } from "@/components/brand-logo";
import Link from "next/link";
+const siteNavItems = [
+ { title: "Home", href: "/" },
+ { title: "Download", href: "/download" },
+ { title: "Pricing", href: "/pricing" },
+ { title: "Docs", href: "/docs" },
+ { title: "Blog", href: "/blog" },
+ { title: "Support", href: "/support" },
+];
+
export default function DocsLayout({ children }: { children: React.ReactNode }) {
return (
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
+
{children}
diff --git a/apps/web/src/components/docs/mobile-nav.tsx b/apps/web/src/components/docs/mobile-nav.tsx
new file mode 100644
index 0000000..da9cc66
--- /dev/null
+++ b/apps/web/src/components/docs/mobile-nav.tsx
@@ -0,0 +1,109 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { createPortal } from "react-dom";
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+import { Menu, X } from "lucide-react";
+import { DocsSidebarContent } from "@/components/docs/sidebar";
+import { cn } from "@/lib/utils";
+
+const siteNavItems = [
+ { title: "Home", href: "/" },
+ { title: "Download", href: "/download" },
+ { title: "Pricing", href: "/pricing" },
+ { title: "Docs", href: "/docs" },
+ { title: "Blog", href: "/blog" },
+ { title: "Support", href: "/support" },
+];
+
+export function DocsMobileNav() {
+ const [open, setOpen] = useState(false);
+ const pathname = usePathname();
+ const close = () => setOpen(false);
+
+ useEffect(() => {
+ if (!open) return;
+ document.body.style.overflow = "hidden";
+ const onKey = (e: KeyboardEvent) => {
+ if (e.key === "Escape") setOpen(false);
+ };
+ window.addEventListener("keydown", onKey);
+ return () => {
+ document.body.style.overflow = "";
+ window.removeEventListener("keydown", onKey);
+ };
+ }, [open ]);
+
+ return (
+
+
+
+ {open &&
+ typeof document !== "undefined" &&
+ createPortal(
+
+
+
+
+ Menu
+
+
+
+
+
+
+
+ Site
+
+
+
+
+ ,
+ document.body
+ )}
+
+ );
+}
diff --git a/apps/web/src/components/docs/sidebar.tsx b/apps/web/src/components/docs/sidebar.tsx
index f530793..2ab83c1 100644
--- a/apps/web/src/components/docs/sidebar.tsx
+++ b/apps/web/src/components/docs/sidebar.tsx
@@ -27,37 +27,46 @@ const navItems = [
},
];
-export function DocsSidebar() {
+export const docsNavItems = navItems;
+
+export function DocsSidebarContent({ onNavigate }: { onNavigate?: () => void }) {
const pathname = usePathname();
return (
-