diff --git a/src/components/DonateButton.tsx b/src/components/DonateButton.tsx index 8ce0e71e..1bad49e3 100644 --- a/src/components/DonateButton.tsx +++ b/src/components/DonateButton.tsx @@ -17,16 +17,22 @@ */ import { Button } from "@webpack/common"; +import { ButtonProps } from "@webpack/types"; import { Heart } from "./Heart"; -export default function DonateButton(props: any) { +export default function DonateButton({ + look = Button.Looks.LINK, + color = Button.Colors.TRANSPARENT, + ...props +}: Partial) { return ( - ! - - - {Switches.map( - s => - s && ( - (settings[s.key] = v)} - note={ - s.warning.enabled ? ( - <> - {s.note} -
- {s.warning.message} -
- - ) : ( - s.note - ) + warning: { enabled: boolean; message?: string; }; + } + > = [ + { + key: "useQuickCss", + title: "Enable Custom CSS", + note: "Loads your Custom CSS", + warning: { enabled: false }, + }, + !IS_WEB && { + key: "enableReactDevtools", + title: "Enable React Developer Tools", + note: "Requires a full restart", + warning: { enabled: false }, + }, + !IS_WEB && + (!IS_DISCORD_DESKTOP || !isWindows + ? { + key: "frameless", + title: "Disable the window frame", + note: "Requires a full restart", + warning: { enabled: false }, } - > - {s.title} -
- ), - )} - + : { + key: "winNativeTitleBar", + title: + "Use Windows' native title bar instead of Discord's custom one", + note: "Requires a full restart", + warning: { enabled: false }, + }), + !IS_WEB && { + key: "transparent", + title: "Enable window transparency.", + note: "You need a theme that supports transparency or this will do nothing. Requires a full restart!", + warning: { + enabled: isWindows, + message: "Enabling this will prevent you from snapping this window.", + }, + }, + !IS_WEB && + isWindows && { + key: "winCtrlQ", + title: + "Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)", + note: "Requires a full restart", + warning: { enabled: false }, + }, + IS_DISCORD_DESKTOP && { + key: "disableMinSize", + title: "Disable minimum window size", + note: "Requires a full restart", + warning: { enabled: false }, + }, + ]; - {needsVibrancySettings && ( - <> - - Window vibrancy style (requires restart) - - (settings.macosVibrancyStyle = v)} + isSelected={v => settings.macosVibrancyStyle === v} + serialize={identity} + /> + + )} + + + + + + + + + ); } -interface DiscordInviteProps { - invite: string; - image: string; +function DonateButtonComponent() { + return ( + + ); } -function DiscordInviteCard({ invite, image }: DiscordInviteProps) { - return ( - -
- Join the discord! - - Please consider joining the discord for any news on breaking changes, - or new bigger updates! - - - - You can also donate to me if you'd like to support this project. - +function isVCDonor(userId: string): boolean { + const donorBadges = BadgeAPI.getDonorBadges(userId); + return GuildMemberStore.getMember(VC_GUILD_ID, userId)?.roles.includes(VC_DONOR_ROLE_ID) || !!donorBadges; +} -
- - - -
-
- -
- ); +function isDonor(userId: string): boolean { + const donorBadges = BadgeAPI.getDonorBadges(userId); + return GuildMemberStore.getMember(GUILD_ID, userId)?.roles.includes(DONOR_ROLE_ID) || !!donorBadges; } export default wrapTab(EquicordSettings, "Equicord Settings"); diff --git a/src/components/VencordSettings/quickActions.css b/src/components/VencordSettings/quickActions.css index 471c394e..b8bc0071 100644 --- a/src/components/VencordSettings/quickActions.css +++ b/src/components/VencordSettings/quickActions.css @@ -1,12 +1,17 @@ .vc-settings-quickActions-card { display: grid; - grid-template-columns: repeat(auto-fill, minmax(200px, max-content)); + grid-template-columns: repeat(3, 1fr); gap: 0.5em; - justify-content: center; - padding: 0.5em 0; + padding: 0.5em; margin-bottom: 1em; } +@media (width <=1040px) { + .vc-settings-quickActions-card { + grid-template-columns: repeat(2, 1fr); + } +} + .vc-settings-quickActions-pill { all: unset; background: var(--background-secondary); @@ -14,12 +19,16 @@ display: flex; align-items: center; gap: 0.5em; - padding: 8px 12px; - border-radius: 9999px; + padding: 8px 9px; + border-radius: 8px; + transition: 0.1s ease-out; + box-sizing: border-box; } .vc-settings-quickActions-pill:hover { background: var(--background-secondary-alt); + transform: translateY(-1px); + box-shadow: var(--elevation-high); } .vc-settings-quickActions-pill:focus-visible { @@ -30,4 +39,4 @@ .vc-settings-quickActions-img { width: 24px; height: 24px; -} +} \ No newline at end of file diff --git a/src/components/VencordSettings/specialCard.css b/src/components/VencordSettings/specialCard.css new file mode 100644 index 00000000..07b628f5 --- /dev/null +++ b/src/components/VencordSettings/specialCard.css @@ -0,0 +1,92 @@ +.vc-donate-button { + overflow: visible !important; +} + +.vc-donate-button .vc-heart-icon { + transition: transform 0.3s; +} + +.vc-donate-button:hover .vc-heart-icon { + transform: scale(1.1); + z-index: 10; + position: relative; +} + +.vc-settings-card { + padding: 1em; + margin-bottom: 1em; +} + +.vc-special-card-special { + padding: 1em 1.5em; + margin-bottom: 1em; + background-size: cover; + background-position: center; +} + +.vc-special-card-flex { + display: flex; + flex-direction: row; +} + +.vc-special-card-flex-main { + width: 100%; +} + +.vc-special-title { + color: black; +} + +.vc-special-subtitle { + color: black; + font-size: 1.2em; + font-weight: bold; + margin-top: 0.5em; +} + +.vc-special-text { + color: black; + font-size: 1em; + margin-top: .75em; + white-space: pre-line; +} + +.vc-special-seperator { + margin-top: .75em; + border-top: 1px solid white; + opacity: 0.4; +} + +.vc-special-hyperlink { + margin-top: 1em; + cursor: pointer; + + .vc-special-hyperlink-text { + color: black; + font-size: 1em; + font-weight: bold; + text-align: center; + transition: text-decoration 0.5s; + cursor: pointer; + } + + &:hover .vc-special-hyperlink-text { + text-decoration: underline; + } +} + +.vc-special-image-container { + display: flex; + justify-content: center; + align-items: center; + margin-left: 1em; + flex-shrink: 0; + width: 100px; + height: 100px; + border-radius: 50%; + background-color: white; +} + +.vc-special-image { + width: 65%; +} diff --git a/src/components/iconStyles.css b/src/components/iconStyles.css index ca4075da..e6d49a26 100644 --- a/src/components/iconStyles.css +++ b/src/components/iconStyles.css @@ -5,3 +5,8 @@ .vc-owner-crown-icon { color: var(--text-warning); } + +.vc-heart-icon { + margin-right: 0.5em; + translate: 0 2px; +} diff --git a/src/plugins/_core/supportHelper.tsx b/src/plugins/_core/supportHelper.tsx index c4885294..2e8564df 100644 --- a/src/plugins/_core/supportHelper.tsx +++ b/src/plugins/_core/supportHelper.tsx @@ -22,7 +22,7 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Flex } from "@components/Flex"; import { Link } from "@components/Link"; import { openUpdaterModal } from "@components/VencordSettings/UpdaterTab"; -import { Devs, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_GUILD_ID, VC_SUPPORT_CHANNEL_ID } from "@utils/constants"; +import { CONTRIB_ROLE_ID, Devs, DONOR_ROLE_ID, EQUIBOP_CONTRIB_ROLE_ID, EQUICORD_TEAM, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_CONTRIB_ROLE_ID, VC_DONOR_ROLE_ID, VC_KNOWN_ISSUES_CHANNEL_ID, VC_REGULAR_ROLE_ID, VC_SUPPORT_CHANNEL_ID, VENBOT_USER_ID, VENCORD_CONTRIB_ROLE_ID } from "@utils/constants"; import { sendMessage } from "@utils/discord"; import { Logger } from "@utils/Logger"; import { Margins } from "@utils/margins"; @@ -40,18 +40,17 @@ import plugins, { PluginMeta } from "~plugins"; import SettingsPlugin from "./settings"; -const VENBOT_USER_ID = "1017176847865352332"; -const KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920"; const CodeBlockRe = /```js\n(.+?)```/s; const TrustedRolesIds = [ - "1026534353167208489", // contributor - "1026504932959977532", // regular - "1042507929485586532", // donor - "1173520023239786538", // Equicord Team - "1222677964760682556", // Equicord Contributor - "1287079931645263968", // Equibop Contributor - "1173343399470964856", // Vencord Contributor + VC_CONTRIB_ROLE_ID, // Vencord Contributor + VC_REGULAR_ROLE_ID, // Vencord Regular + VC_DONOR_ROLE_ID, // Vencord Donor + EQUICORD_TEAM, // Equicord Team + DONOR_ROLE_ID, // Equicord Donor + CONTRIB_ROLE_ID, // Equicord Contributor + EQUIBOP_CONTRIB_ROLE_ID, // Equibop Contributor + VENCORD_CONTRIB_ROLE_ID, // Vencord Contributor ]; const AsyncFunction = async function () { }.constructor; @@ -261,8 +260,8 @@ export default definePlugin({ const shouldAddUpdateButton = !IS_UPDATER_DISABLED && ( - (props.channel.id === KNOWN_ISSUES_CHANNEL_ID) || - (props.channel.id === SUPPORT_CHANNEL_ID && props.message.author.id === VENBOT_USER_ID) + (props.channel.id === VC_KNOWN_ISSUES_CHANNEL_ID) || + (props.channel.id === VC_SUPPORT_CHANNEL_ID && props.message.author.id === VENBOT_USER_ID) ) && props.message.content?.includes("update"); diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 85eb4619..50783178 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -18,12 +18,29 @@ export const WEBPACK_CHUNK = "webpackChunkdiscord_app"; export const REACT_GLOBAL = "Vencord.Webpack.Common.React"; + +// Equicord export const SUPPORT_CHANNEL_ID = "1297590739911573585"; -export const VC_SUPPORT_CHANNEL_ID = "1026515880080842772"; -export const SUPPORT_CHANNEL_IDS = [SUPPORT_CHANNEL_ID, VC_SUPPORT_CHANNEL_ID]; export const GUILD_ID = "1173279886065029291"; +export const DONOR_ROLE_ID = "1173316879083896912"; +export const CONTRIB_ROLE_ID = "1222677964760682556"; +export const EQUICORD_TEAM = "1173520023239786538"; +export const EQUIBOP_CONTRIB_ROLE_ID = "1287079931645263968"; +export const VENCORD_CONTRIB_ROLE_ID = "1173343399470964856"; + +// Vencord +export const VC_SUPPORT_CHANNEL_ID = "1026515880080842772"; export const VC_GUILD_ID = "1015060230222131221"; +export const VENBOT_USER_ID = "1017176847865352332"; +export const VC_DONOR_ROLE_ID = "1042507929485586532"; +export const VC_CONTRIB_ROLE_ID = "1026534353167208489"; +export const VC_REGULAR_ROLE_ID = "1026504932959977532"; +export const VC_KNOWN_ISSUES_CHANNEL_ID = "1222936386626129920"; + export const GUILD_IDS = [GUILD_ID, VC_GUILD_ID]; +export const SUPPORT_CHANNEL_IDS = [SUPPORT_CHANNEL_ID, VC_SUPPORT_CHANNEL_ID]; +export const DONOR_ROLE_IDS = [DONOR_ROLE_ID, VC_DONOR_ROLE_ID]; +export const CONTRIB_ROLE_IDS = [CONTRIB_ROLE_ID, EQUIBOP_CONTRIB_ROLE_ID, VENCORD_CONTRIB_ROLE_ID, VC_CONTRIB_ROLE_ID]; export interface Dev { name: string; @@ -584,6 +601,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "jamesbt365", id: 158567567487795200n, }, + samsam: { + name: "samsam", + id: 836452332387565589n, + }, } satisfies Record); export const EquicordDevs = Object.freeze({ diff --git a/src/utils/settingsSync.ts b/src/utils/settingsSync.ts index 9b1d2f99..fc5c4172 100644 --- a/src/utils/settingsSync.ts +++ b/src/utils/settingsSync.ts @@ -60,7 +60,7 @@ export async function downloadSettingsBackup() { } } -const toast = (type: number, message: string) => +const toast = (type: string, message: string) => Toasts.show({ type, message, diff --git a/src/webpack/common/types/components.d.ts b/src/webpack/common/types/components.d.ts index 2e2082f1..3a977f9a 100644 --- a/src/webpack/common/types/components.d.ts +++ b/src/webpack/common/types/components.d.ts @@ -152,7 +152,7 @@ export type ComboboxPopout = ComponentType>; -export type Button = ComponentType, "size"> & { +export interface ButtonProps extends PropsWithChildren, "size">> { /** Button.Looks.FILLED */ look?: string; /** Button.Colors.BRAND */ @@ -172,7 +172,9 @@ export type Button = ComponentType> & { +} + +export type Button = ComponentType & { BorderColors: Record<"BLACK" | "BRAND" | "BRAND_NEW" | "GREEN" | "LINK" | "PRIMARY" | "RED" | "TRANSPARENT" | "WHITE" | "YELLOW", string>; Colors: Record<"BRAND" | "RED" | "GREEN" | "YELLOW" | "PRIMARY" | "LINK" | "WHITE" | "BLACK" | "TRANSPARENT" | "BRAND_NEW" | "CUSTOM", string>; Hovers: Record<"DEFAULT" | "BRAND" | "RED" | "GREEN" | "YELLOW" | "PRIMARY" | "LINK" | "WHITE" | "BLACK" | "TRANSPARENT", string>; diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index 1b3a28d6..f08cf344 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -74,10 +74,15 @@ export let Alerts: t.Alerts; waitFor(["show", "close"], m => Alerts = m); const ToastType = { - MESSAGE: 0, - SUCCESS: 1, - FAILURE: 2, - CUSTOM: 3 + MESSAGE: "message", + SUCCESS: "success", + FAILURE: "failure", + CUSTOM: "custom", + CLIP: "clip", + LINK: "link", + FORWARD: "forward", + BOOKMARK: "bookmark", + CLOCK: "clock" }; const ToastPosition = { TOP: 0, @@ -90,7 +95,7 @@ export interface ToastData { /** * Toasts.Type */ - type: number, + type: string, options?: ToastOptions; } @@ -113,7 +118,7 @@ export const Toasts = { ...{} as { show(data: ToastData): void; pop(): void; - create(message: string, type: number, options?: ToastOptions): ToastData; + create(message: string, type: string, options?: ToastOptions): ToastData; } };