feat(ui): add GithubLinkButton component

This commit is contained in:
rustmailer
2025-11-09 01:44:39 +08:00
parent c60f2cd444
commit 520ef0cb44
2 changed files with 37 additions and 0 deletions
@@ -8,6 +8,7 @@ import { ThemeSwitch } from "../theme-switch";
import { ProfileDropdown } from "../profile-dropdown";
import { Header } from "./header";
import { NotificationPopover } from "./notification";
import { GithubLinkButton } from "./github";
export const FixedHeader = () => {
return (
@@ -15,6 +16,7 @@ export const FixedHeader = () => {
{/* <Search /> */}
<div className='ml-auto flex items-center space-x-4'>
<NotificationPopover />
<GithubLinkButton />
<ThemeSwitch />
<ProfileDropdown />
</div>
+35
View File
@@ -0,0 +1,35 @@
/*
* Copyright © 2025 rustmailer.com
* Licensed under RustMailer License Agreement v1.0
* Unauthorized use or distribution is prohibited.
*/
import React from "react";
import { GitHubLogoIcon } from "@radix-ui/react-icons";
interface GithubLinkButtonProps {
/** GitHub repository or profile URL */
href?: string;
/** Icon size (default: 20) */
size?: number;
/** Optional tooltip title */
title?: string;
}
export const GithubLinkButton: React.FC<GithubLinkButtonProps> = ({
href = "https://github.com/rustmailer/rustmailer",
size = 20,
title = "View on GitHub",
}) => {
return (
<a
href={href}
target="_blank"
rel="noopener noreferrer"
title={title}
className="inline-flex items-center justify-center rounded-full p-2 text-muted-foreground hover:text-foreground hover:bg-muted transition-colors"
>
<GitHubLogoIcon className="w-5 h-5" style={{ width: size, height: size }} />
</a>
);
};