mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +00:00
39 lines
1 KiB
TypeScript
39 lines
1 KiB
TypeScript
/*
|
|
* Vencord, a Discord client mod
|
|
* Copyright (c) 2024 Vendicated and contributors
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
import "./LinkIconButton.css";
|
|
|
|
import { MaskedLink, Tooltip } from "@webpack/common";
|
|
|
|
import { GithubIcon, WebsiteIcon } from "..";
|
|
|
|
export function GithubLinkIcon() {
|
|
return <GithubIcon aria-hidden className={"vc-settings-modal-link-icon"} />;
|
|
}
|
|
|
|
export function WebsiteLinkIcon() {
|
|
return <WebsiteIcon aria-hidden className={"vc-settings-modal-link-icon"} />;
|
|
}
|
|
|
|
interface Props {
|
|
text: string;
|
|
href: string;
|
|
}
|
|
|
|
function LinkIcon({ text, href, Icon }: Props & { Icon: React.ComponentType; }) {
|
|
return (
|
|
<Tooltip text={text}>
|
|
{props => (
|
|
<MaskedLink {...props} href={href}>
|
|
<Icon />
|
|
</MaskedLink>
|
|
)}
|
|
</Tooltip>
|
|
);
|
|
}
|
|
|
|
export const WebsiteButton = (props: Props) => <LinkIcon {...props} Icon={WebsiteLinkIcon} />;
|
|
export const GithubButton = (props: Props) => <LinkIcon {...props} Icon={GithubLinkIcon} />;
|