diff --git a/components/docs-shell.tsx b/components/docs-shell.tsx index f5df8e0..9a366ef 100644 --- a/components/docs-shell.tsx +++ b/components/docs-shell.tsx @@ -12,6 +12,7 @@ import { usePathname } from "next/navigation" import { DocsSidebar } from "@/components/docs-sidebar" import { DocsSidebarTrigger } from "@/components/docs-sidebar-trigger" +import { GithubSponsor } from "@/components/github-sponsor" import { GithubStars } from "@/components/github-stars" import { Logo } from "@/components/logo" import { SearchTrigger } from "@/components/search-trigger" @@ -177,16 +178,13 @@ export function DocsShell({ -
-
- -
- - -
-
- -
+
+ +
+ + + +
+ + Sponsor + + ) +} diff --git a/components/search-trigger.tsx b/components/search-trigger.tsx index a37d402..608d5ab 100644 --- a/components/search-trigger.tsx +++ b/components/search-trigger.tsx @@ -1,19 +1,14 @@ "use client" -import { useEffect, useState } from "react" import { Dialog } from "@base-ui/react/dialog" import { useSearchContext } from "fumadocs-ui/contexts/search" import { RiSearchLine } from "@remixicon/react" +import { buttonVariants } from "@/components/ui/button" import { cn } from "@/lib/utils" export function SearchTrigger({ className }: { className?: string }) { - const { enabled, dialogHandle, hotKey } = useSearchContext() - const [mounted, setMounted] = useState(false) - - useEffect(() => { - setMounted(true) - }, []) + const { enabled, dialogHandle } = useSearchContext() if (!enabled) return null @@ -22,27 +17,13 @@ export function SearchTrigger({ className }: { className?: string }) { handle={dialogHandle} type="button" className={cn( - "flex h-8 w-full min-w-0 items-center gap-2 rounded-2xl bg-input/50 px-2.5 text-sm text-muted-foreground outline-none transition-[color,box-shadow] hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30", + buttonVariants({ variant: "ghost", size: "icon-sm" }), + "text-muted-foreground hover:text-foreground", className )} aria-label="Open search" > - - Search - {mounted ? ( - - {hotKey.map((k, i) => ( - - {k.display} - - ))} - - ) : ( - - )} + ) } diff --git a/lib/github.ts b/lib/github.ts index 0315fa4..d5c2789 100644 --- a/lib/github.ts +++ b/lib/github.ts @@ -1,9 +1,14 @@ const REPO = "radiumcoders/23rd.dev" +const OWNER = REPO.split("/")[0] export function getGithubRepoUrl() { return `https://github.com/${REPO}` } +export function getGithubSponsorUrl() { + return `https://github.com/sponsors/${OWNER}` +} + export function formatStarCount(count: number) { return new Intl.NumberFormat("en", { notation: "compact",