From fc47045aa5acdb1de3d0b9f6ca12fa447d7f8455 Mon Sep 17 00:00:00 2001 From: Radiumcoders Date: Thu, 17 Sep 2026 15:59:12 +0530 Subject: [PATCH 1/2] feat: add a GitHub Sponsors button to the docs navbar Co-authored-by: Cursor --- components/docs-shell.tsx | 2 ++ components/github-sponsor.tsx | 22 ++++++++++++++++++++++ lib/github.ts | 5 +++++ 3 files changed, 29 insertions(+) create mode 100644 components/github-sponsor.tsx diff --git a/components/docs-shell.tsx b/components/docs-shell.tsx index f5df8e0..7bac962 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" @@ -181,6 +182,7 @@ export function DocsShell({
+
diff --git a/components/github-sponsor.tsx b/components/github-sponsor.tsx new file mode 100644 index 0000000..6506b43 --- /dev/null +++ b/components/github-sponsor.tsx @@ -0,0 +1,22 @@ +import { RiHeart3Line } from "@remixicon/react" + +import { getGithubSponsorUrl } from "@/lib/github" +import { cn } from "@/lib/utils" + +export function GithubSponsor({ className }: { className?: string }) { + return ( + + + Sponsor + + ) +} 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", From 40b329cebd2091fa82b5371b36d6cf81d4d332b3 Mon Sep 17 00:00:00 2001 From: Radiumcoders Date: Thu, 17 Sep 2026 16:07:25 +0530 Subject: [PATCH 2/2] fix: collapse docs search to an icon so the navbar fits Co-authored-by: Cursor --- components/docs-shell.tsx | 18 +++++++----------- components/search-trigger.tsx | 29 +++++------------------------ 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/components/docs-shell.tsx b/components/docs-shell.tsx index 7bac962..9a366ef 100644 --- a/components/docs-shell.tsx +++ b/components/docs-shell.tsx @@ -178,17 +178,13 @@ export function DocsShell({ -
-
- -
- - - -
-
- -
+
+ +
+ + + +
{ - 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} - - ))} - - ) : ( - - )} + ) }