mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-11 01:44:38 +00:00
Refactor GitHubStarsButton to wrap in Link component for external navigation
This commit is contained in:
parent
4493d86e51
commit
e996776781
1 changed files with 31 additions and 23 deletions
|
@ -2,6 +2,7 @@ import type { VariantProps } from "class-variance-authority";
|
||||||
|
|
||||||
import { cva } from "class-variance-authority";
|
import { cva } from "class-variance-authority";
|
||||||
import { StarIcon } from "lucide-react";
|
import { StarIcon } from "lucide-react";
|
||||||
|
import Link from "next/link";
|
||||||
|
|
||||||
import type { ButtonProps as ButtonPrimitiveProps } from "@/components/animate-ui/primitives/buttons/button";
|
import type { ButtonProps as ButtonPrimitiveProps } from "@/components/animate-ui/primitives/buttons/button";
|
||||||
import type { GithubStarsProps } from "@/components/animate-ui/primitives/animate/github-stars";
|
import type { GithubStarsProps } from "@/components/animate-ui/primitives/animate/github-stars";
|
||||||
|
@ -71,30 +72,37 @@ function GitHubStarsButton({
|
||||||
...props
|
...props
|
||||||
}: GitHubStarsButtonProps) {
|
}: GitHubStarsButtonProps) {
|
||||||
return (
|
return (
|
||||||
<GithubStars
|
<Link
|
||||||
asChild
|
target="_blank"
|
||||||
username={username}
|
rel="noopener noreferrer"
|
||||||
repo={repo}
|
data-umami-event="github-stars"
|
||||||
value={value}
|
href={`https://github.com/${username}/${repo}`}
|
||||||
delay={delay}
|
|
||||||
inView={inView}
|
|
||||||
inViewMargin={inViewMargin}
|
|
||||||
inViewOnce={inViewOnce}
|
|
||||||
>
|
>
|
||||||
<ButtonPrimitive className={cn(buttonVariants({ variant, size, className }))} {...props}>
|
<GithubStars
|
||||||
<GithubStarsLogo />
|
asChild
|
||||||
<GithubStarsNumber />
|
username={username}
|
||||||
<GithubStarsParticles className="text-yellow-500">
|
repo={repo}
|
||||||
<GithubStarsIcon
|
value={value}
|
||||||
icon={StarIcon}
|
delay={delay}
|
||||||
data-variant={variant}
|
inView={inView}
|
||||||
className={cn(buttonStarVariants({ variant }))}
|
inViewMargin={inViewMargin}
|
||||||
activeClassName="text-yellow-500"
|
inViewOnce={inViewOnce}
|
||||||
size={18}
|
>
|
||||||
/>
|
<ButtonPrimitive className={cn(buttonVariants({ variant, size, className }))} {...props}>
|
||||||
</GithubStarsParticles>
|
<GithubStarsLogo />
|
||||||
</ButtonPrimitive>
|
<GithubStarsNumber />
|
||||||
</GithubStars>
|
<GithubStarsParticles className="text-yellow-500">
|
||||||
|
<GithubStarsIcon
|
||||||
|
icon={StarIcon}
|
||||||
|
data-variant={variant}
|
||||||
|
className={cn(buttonStarVariants({ variant }))}
|
||||||
|
activeClassName="text-yellow-500"
|
||||||
|
size={18}
|
||||||
|
/>
|
||||||
|
</GithubStarsParticles>
|
||||||
|
</ButtonPrimitive>
|
||||||
|
</GithubStars>
|
||||||
|
</Link>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue