diff --git a/src/components/Alert.tsx b/src/components/Alert.tsx index 60c21f448..8e83f5738 100644 --- a/src/components/Alert.tsx +++ b/src/components/Alert.tsx @@ -5,7 +5,7 @@ */ import { filters, mapMangledModuleLazy } from "@webpack"; -import type { ReactNode } from "react"; +import type { ComponentType, CSSProperties, ReactNode } from "react"; const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE="positive', { HelpMessageTypes: filters.byProps("POSITIVE", "WARNING", "INFO", "ERROR"), @@ -15,35 +15,37 @@ const { HelpMessage, HelpMessageTypes } = mapMangledModuleLazy('POSITIVE="positi export interface AlertProps { children: ReactNode; className?: string; + style?: CSSProperties; + icon?: ComponentType<{ className?: string; color?: string; }>; } -function Warning({ children, className }: AlertProps) { +function Warning({ children, className, style, icon }: AlertProps) { return ( - + {children} ); } -function Info({ children, className }: AlertProps) { +function Info({ children, className, style, icon }: AlertProps) { return ( - + {children} ); } -function Error({ children, className }: AlertProps) { +function Error({ children, className, style, icon }: AlertProps) { return ( - + {children} ); } -function Positive({ children, className }: AlertProps) { +function Positive({ children, className, style, icon }: AlertProps) { return ( - + {children} ); diff --git a/src/components/ThemeSettings/ThemesTab.tsx b/src/components/ThemeSettings/ThemesTab.tsx index 279b9d862..f283e48e3 100644 --- a/src/components/ThemeSettings/ThemesTab.tsx +++ b/src/components/ThemeSettings/ThemesTab.tsx @@ -21,6 +21,7 @@ import "./themesStyles.css"; import { isPluginEnabled } from "@api/PluginManager"; import { Settings, useSettings } from "@api/Settings"; import { classNameFactory } from "@api/Styles"; +import { Button } from "@components/Button"; import { Card } from "@components/Card"; import { Divider } from "@components/Divider"; import { ErrorCard } from "@components/ErrorCard"; @@ -43,7 +44,7 @@ import { getThemeInfo, stripBOM, type UserThemeHeader } from "@utils/themes/bd"; import { usercssParse } from "@utils/themes/usercss"; import { getStylusWebStoreUrl } from "@utils/web"; import { findLazy } from "@webpack"; -import { Alerts, Button, React, showToast, TabBar, TextInput, Tooltip, useEffect, useMemo, useRef, useState } from "@webpack/common"; +import { Alerts, React, showToast, TabBar, TextInput, Tooltip, useEffect, useMemo, useRef, useState } from "@webpack/common"; import type { ComponentType, Ref, SyntheticEvent } from "react"; import type { UserstyleHeader } from "usercss-meta"; @@ -599,7 +600,7 @@ export function CspErrorCard() { {i !== 0 && }
{url} -
diff --git a/src/components/ThemeSettings/UserCSSModal.tsx b/src/components/ThemeSettings/UserCSSModal.tsx index c98c3deef..b4f3e4812 100644 --- a/src/components/ThemeSettings/UserCSSModal.tsx +++ b/src/components/ThemeSettings/UserCSSModal.tsx @@ -90,8 +90,8 @@ function ResetButton({ themeSettings, themeId, close, onReset }: ResetButtonProp onMouseEnter={onMouseEnter} onMouseLeave={onMouseLeave} - onClick={async () => { - await close(); // close the modal first to stop rendering + onClick={() => { + close(); // close the modal first to stop rendering delete themeSettings[themeId]; onReset(); }}> diff --git a/src/components/settings/DonateButton.tsx b/src/components/settings/DonateButton.tsx index eb2a91e25..cc455305f 100644 --- a/src/components/settings/DonateButton.tsx +++ b/src/components/settings/DonateButton.tsx @@ -16,41 +16,24 @@ * along with this program. If not, see . */ +import { Button } from "@components/Button"; import { Heart } from "@components/Heart"; import { openInviteModal } from "@utils/discord"; import { ButtonProps } from "@vencord/discord-types"; -import { Button, showToast } from "@webpack/common"; - -export function VCDonateButton({ - look = Button.Looks.LINK, - color = Button.Colors.TRANSPARENT, - ...props -}: Partial) { - return ( - - ); -} +import { showToast } from "@webpack/common"; export function DonateButton({ - look = Button.Looks.LINK, - color = Button.Colors.TRANSPARENT, + equicord = false, ...props -}: Partial) { +}: Partial & { equicord?: boolean; }) { + const link = equicord ? "https://github.com/sponsors/thororen1234" : "https://github.com/sponsors/Vendicated"; return ( {!Settings.ignoreResetWarning && ( )} diff --git a/src/components/settings/tabs/sync/CloudTab.tsx b/src/components/settings/tabs/sync/CloudTab.tsx index a01cbee6a..ad77e4bdf 100644 --- a/src/components/settings/tabs/sync/CloudTab.tsx +++ b/src/components/settings/tabs/sync/CloudTab.tsx @@ -19,6 +19,7 @@ import { useSettings } from "@api/Settings"; import { authorizeCloud, deauthorizeCloud } from "@api/SettingsSync/cloudSetup"; import { deleteCloudSettings, eraseAllCloudData, getCloudSettings, putCloudSettings } from "@api/SettingsSync/cloudSync"; +import { Button } from "@components/Button"; import { CheckedTextInput } from "@components/CheckedTextInput"; import { Divider } from "@components/Divider"; import { FormSwitch } from "@components/FormSwitch"; @@ -28,7 +29,7 @@ import { Link } from "@components/Link"; import { Paragraph } from "@components/Paragraph"; import { SettingsTab, wrapTab } from "@components/settings/tabs/BaseTab"; import { Margins } from "@utils/margins"; -import { Alerts, Button, Tooltip, useState } from "@webpack/common"; +import { Alerts, Tooltip, useState } from "@webpack/common"; function validateUrl(url: string) { try { @@ -60,7 +61,7 @@ function SettingsSyncSection() { />
- - diff --git a/src/components/settings/tabs/updater/Components.tsx b/src/components/settings/tabs/updater/Components.tsx index 8e3757c96..b56419dad 100644 --- a/src/components/settings/tabs/updater/Components.tsx +++ b/src/components/settings/tabs/updater/Components.tsx @@ -4,6 +4,7 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import { Button } from "@components/Button"; import { Card } from "@components/Card"; import { ErrorCard } from "@components/ErrorCard"; import { Flex } from "@components/Flex"; @@ -13,7 +14,7 @@ import { Margins } from "@utils/margins"; import { classes } from "@utils/misc"; import { relaunch } from "@utils/native"; import { changes, checkForUpdates, update, updateError } from "@utils/updater"; -import { Alerts, Button, React, Toasts, useState } from "@webpack/common"; +import { Alerts, React, Toasts, useState } from "@webpack/common"; import { runWithDispatch } from "./runWithDispatch"; @@ -95,7 +96,7 @@ export function Updatable(props: CommonProps) { {isOutdated && ( )} }