Merge branch 'dev'

This commit is contained in:
thororen1234 2024-10-24 18:27:32 -04:00
commit f740f59473
2 changed files with 41 additions and 12 deletions

View file

@ -19,16 +19,16 @@
import { openNotificationLogModal } from "@api/Notifications/notificationLog"; import { openNotificationLogModal } from "@api/Notifications/notificationLog";
import { useSettings } from "@api/Settings"; import { useSettings } from "@api/Settings";
import { classNameFactory } from "@api/Styles"; import { classNameFactory } from "@api/Styles";
import DonateButton from "@components/DonateButton";
import { openPluginModal } from "@components/PluginSettings/PluginModal"; import { openPluginModal } from "@components/PluginSettings/PluginModal";
import { gitRemote } from "@shared/vencordUserAgent"; import { gitRemote } from "@shared/vencordUserAgent";
import { openInviteModal } from "@utils/discord";
import { Margins } from "@utils/margins"; import { Margins } from "@utils/margins";
import { identity } from "@utils/misc"; import { identity } from "@utils/misc";
import { relaunch, showItemInFolder } from "@utils/native"; import { relaunch, showItemInFolder } from "@utils/native";
import { useAwaiter } from "@utils/react"; import { useAwaiter } from "@utils/react";
import { Button, Card, Forms, React, Select, Switch } from "@webpack/common"; import { Button, Card, Forms, React, Select, showToast, Switch } from "@webpack/common";
import { Flex, FolderIcon, GithubIcon, LogIcon, PaintbrushIcon, RestartIcon } from ".."; import { Flex, FolderIcon, GithubIcon, Heart, LogIcon, PaintbrushIcon, RestartIcon } from "..";
import { openNotificationSettingsModal } from "./NotificationSettings"; import { openNotificationSettingsModal } from "./NotificationSettings";
import { QuickAction, QuickActionCard } from "./quickActions"; import { QuickAction, QuickActionCard } from "./quickActions";
import { SettingsTab, wrapTab } from "./shared"; import { SettingsTab, wrapTab } from "./shared";
@ -49,6 +49,7 @@ function EquicordSettings() {
}); });
const settings = useSettings(); const settings = useSettings();
const discordInvite = "bFp57wxCkv";
const donateImage = React.useMemo(() => Math.random() > 0.5 ? DEFAULT_DONATE_IMAGE : SHIGGY_DONATE_IMAGE, []); const donateImage = React.useMemo(() => Math.random() > 0.5 ? DEFAULT_DONATE_IMAGE : SHIGGY_DONATE_IMAGE, []);
const isWindows = navigator.platform.toLowerCase().startsWith("win"); const isWindows = navigator.platform.toLowerCase().startsWith("win");
@ -99,7 +100,7 @@ function EquicordSettings() {
return ( return (
<SettingsTab title="Equicord Settings"> <SettingsTab title="Equicord Settings">
<DonateCard image={donateImage} /> <DiscordInviteCard invite={discordInvite} image={donateImage} />
<Forms.FormSection title="Quick Actions"> <Forms.FormSection title="Quick Actions">
<QuickActionCard> <QuickActionCard>
<QuickAction <QuickAction
@ -239,17 +240,36 @@ function EquicordSettings() {
); );
} }
interface DonateCardProps { interface DiscordInviteProps {
invite: string;
image: string; image: string;
} }
function DonateCard({ image }: DonateCardProps) {
function DiscordInviteCard({ invite, image }: DiscordInviteProps) {
return ( return (
<Card className={cl("card", "donate")}> <Card className={cl("card", "discordinvite")}>
<div> <div>
<Forms.FormTitle tag="h5">Support the Project</Forms.FormTitle> <Forms.FormTitle tag="h5">Join the discord!</Forms.FormTitle>
<Forms.FormText>Please consider supporting the development of Equicord by donating!</Forms.FormText> <Forms.FormText>Please consider joining the discord for any news on breaking changes, or new bigger updates!</Forms.FormText>
<DonateButton style={{ transform: "translateX(-1em)" }} /> <Forms.FormText>You can also donate to me if you'd like to support this project. <Heart /></Forms.FormText>
<div className={cl("card-buttons")}>
<Button
onClick={async e => {
e.preventDefault();
openInviteModal(invite).catch(() => showToast("Invalid or expired invite"));
}}
>
Join
</Button>
<Button
onClick={() => { VencordNative.native.openExternal("https://github.com/sponsors/verticalsync"); }}
>
Donate
</Button>
</div>
</div> </div>
<img <img
role="presentation" role="presentation"
@ -257,9 +277,7 @@ function DonateCard({ image }: DonateCardProps) {
alt="" alt=""
height={128} height={128}
style={{ style={{
imageRendering: image === SHIGGY_DONATE_IMAGE ? "pixelated" : void 0,
marginLeft: "auto", marginLeft: "auto",
transform: image === DEFAULT_DONATE_IMAGE ? "rotate(10deg)" : void 0
}} }}
/> />
</Card> </Card>

View file

@ -15,11 +15,22 @@
flex-direction: row; flex-direction: row;
} }
.vc-settings-discordinvite {
display: flex;
flex-direction: row;
}
.vc-settings-card { .vc-settings-card {
padding: 1em; padding: 1em;
margin-bottom: 1em; margin-bottom: 1em;
} }
.vc-settings-card-buttons {
display: flex;
margin-top: 1.5em;
gap: 0.5em;
}
.vc-backup-restore-card { .vc-backup-restore-card {
background-color: var(--info-warning-background); background-color: var(--info-warning-background);
border-color: var(--info-warning-foreground); border-color: var(--info-warning-foreground);