mirror of
https://github.com/jnsahaj/tweakcn.git
synced 2026-08-28 23:02:07 +08:00
154f802cf5
* chore: allow overriding ControlSection classNames * feat: Support Google Fonts API and load fonts dynamically * feat: Enforce System Prompt to use Google Fonts API if needed * styles: Improve GoogleFontPicker styles * feat: Pull Fonts from fileSystem instead of hitting the Google Fonts API every time * feat: Improve System Prompt to reference Google Fonts * refactor: Use Next.js Cache instead of manually fetching and reading from the filesystem * feat: Only enable Font picker fetch when it's open * chore: Remove JSON for Google Fonts catalogue * feat: Scroll to selected font if it's already fetched and add clean search button * chore: update imports * fix: dashboard preview * feat: Add shadcraft dialog --------- Co-authored-by: Luis Llanes <luisllaboj@gmail.com>
70 lines
2.6 KiB
TypeScript
70 lines
2.6 KiB
TypeScript
"use client";
|
|
|
|
import DiscordIcon from "@/assets/discord.svg";
|
|
import FigmaIcon from "@/assets/figma.svg";
|
|
import GitHubIcon from "@/assets/github.svg";
|
|
import Logo from "@/assets/logo.svg";
|
|
import TwitterIcon from "@/assets/twitter.svg";
|
|
import { FigmaExportDialog } from "@/components/figma-export-dialog";
|
|
import { SocialLink } from "@/components/social-link";
|
|
import { Button } from "@/components/ui/button";
|
|
import { Separator } from "@/components/ui/separator";
|
|
import { UserProfileDropdown } from "@/components/user-profile-dropdown";
|
|
import { useGithubStars } from "@/hooks/use-github-stars";
|
|
import { formatCompactNumber } from "@/utils/format";
|
|
import Link from "next/link";
|
|
import { useState } from "react";
|
|
import { GetProCTA } from "./get-pro-cta";
|
|
|
|
export function Header() {
|
|
const { stargazersCount } = useGithubStars("jnsahaj", "tweakcn");
|
|
const [figmaDialogOpen, setFigmaDialogOpen] = useState(false);
|
|
|
|
return (
|
|
<header className="border-b">
|
|
<div className="flex items-center justify-between gap-2 p-4">
|
|
<div className="flex items-center gap-1">
|
|
<Link href="/" className="flex items-center gap-2">
|
|
<Logo className="size-6" title="tweakcn" />
|
|
<span className="hidden font-bold md:block">tweakcn</span>
|
|
</Link>
|
|
</div>
|
|
<div className="flex items-center gap-3.5">
|
|
<GetProCTA className="h-8" />
|
|
|
|
<SocialLink
|
|
href="https://github.com/jnsahaj/tweakcn"
|
|
className="flex items-center gap-2 text-sm font-bold"
|
|
>
|
|
<GitHubIcon className="size-4" />
|
|
{stargazersCount > 0 && formatCompactNumber(stargazersCount)}
|
|
</SocialLink>
|
|
<Separator orientation="vertical" className="h-8" />
|
|
<div className="flex items-center gap-3.5">
|
|
<div className="hidden items-center gap-3.5 md:flex">
|
|
<SocialLink href="https://discord.gg/Phs4u2NM3n">
|
|
<DiscordIcon className="size-5" />
|
|
</SocialLink>
|
|
</div>
|
|
<SocialLink href="https://x.com/iamsahaj_xyz">
|
|
<TwitterIcon className="size-4" />
|
|
</SocialLink>
|
|
</div>
|
|
<Separator orientation="vertical" className="h-8" />
|
|
<Button
|
|
onClick={() => setFigmaDialogOpen(true)}
|
|
variant="outline"
|
|
className="flex h-8 items-center gap-2"
|
|
>
|
|
<FigmaIcon className="size-4" />
|
|
Export to Figma
|
|
</Button>
|
|
<UserProfileDropdown />
|
|
</div>
|
|
</div>
|
|
|
|
<FigmaExportDialog open={figmaDialogOpen} onOpenChange={setFigmaDialogOpen} />
|
|
</header>
|
|
);
|
|
}
|