Refactor GitHubStarsButton to wrap in Link component for external navigation (#7492)

This commit is contained in:
Bram Suurd 2025-09-09 09:28:32 +02:00 committed by GitHub
parent b6c0b50e79
commit aa4999dac6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,7 @@ import type { VariantProps } from "class-variance-authority";
import { cva } from "class-variance-authority";
import { StarIcon } from "lucide-react";
import Link from "next/link";
import type { ButtonProps as ButtonPrimitiveProps } from "@/components/animate-ui/primitives/buttons/button";
import type { GithubStarsProps } from "@/components/animate-ui/primitives/animate/github-stars";
@ -71,6 +72,12 @@ function GitHubStarsButton({
...props
}: GitHubStarsButtonProps) {
return (
<Link
target="_blank"
rel="noopener noreferrer"
data-umami-event="github-stars"
href={`https://github.com/${username}/${repo}`}
>
<GithubStars
asChild
username={username}
@ -95,6 +102,7 @@ function GitHubStarsButton({
</GithubStarsParticles>
</ButtonPrimitive>
</GithubStars>
</Link>
);
}