diff --git a/web/app/components/github-stars.tsx b/web/app/components/github-stars.tsx index 1dc3adb4..45b2d626 100644 --- a/web/app/components/github-stars.tsx +++ b/web/app/components/github-stars.tsx @@ -11,7 +11,25 @@ function formatStars(count: number): string { return String(count); } -export function GitHubStarsBadge() { +const GITHUB_ICON = ( + + + +); + +export function GitHubStarsBadge({ + location = "stars_badge", + className, +}: { + location?: string; + className?: string; +} = {}) { const [stars, setStars] = useState(null); useEffect(() => { @@ -31,19 +49,11 @@ export function GitHubStarsBadge() { target="_blank" rel="noopener noreferrer" onClick={() => - posthog.capture("cmuxterm_github_clicked", { location: "stars_badge" }) + posthog.capture("cmuxterm_github_clicked", { location }) } - className="inline-flex items-center gap-1.5 pr-1 text-sm text-muted hover:text-foreground transition-colors animate-fade-in" + className={className ?? "inline-flex items-center gap-1.5 pr-1 text-sm text-muted hover:text-foreground transition-colors animate-fade-in"} > - - - + {GITHUB_ICON} {formatStars(stars)} ); diff --git a/web/app/components/site-header.tsx b/web/app/components/site-header.tsx index 81742b99..bc868280 100644 --- a/web/app/components/site-header.tsx +++ b/web/app/components/site-header.tsx @@ -1,7 +1,6 @@ "use client"; import Link from "next/link"; -import posthog from "posthog-js"; import { NavLinks } from "./nav-links"; import { DownloadButton } from "./download-button"; import { ThemeToggle } from "../theme"; @@ -58,9 +57,7 @@ export function SiteHeader({ {/* Right: GitHub stars + Download + theme + mobile */} - - - + @@ -137,15 +134,7 @@ export function SiteHeader({ > Community - posthog.capture("cmuxterm_github_clicked", { location: "mobile_drawer" })} - className="hover:text-foreground transition-colors py-1" - > - GitHub - +