/* * Vencord, a Discord client mod * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import { CodeBlock } from "@components/CodeBlock"; import { Heart } from "@components/Heart"; import { openInviteModal } from "@utils/discord"; import { Margins } from "@utils/margins"; import { ModalContent, ModalFooter, ModalHeader, ModalRoot, openModal } from "@utils/modal"; import { findComponentByCodeLazy } from "@webpack"; import { Button, Clipboard, Forms, React, showToast, Toasts } from "@webpack/common"; import { ThemeInfoModalProps } from "../types"; const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers"); export const ThemeInfoModal: React.FC = ({ author, theme, ...props }) => { const content = atob(theme.content); const metadata = content.match(/\/\*\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\//g)?.[0] || ""; const donate = metadata.match(/@donate\s+(.+)/)?.[1] || ""; const version = metadata.match(/@version\s+(.+)/)?.[1] || ""; return ( Theme Details Author
{author.username}
Source ))} > View Theme Source {version && ( <> Version {version} )} {donate && ( <> Donate You can support the author by donating below. )} {theme.guild && ( <> Support Server {theme.guild.name} )} {theme.tags && ( <> Tags {theme.tags.map(tag => ( {tag} ))} )}
); };