diff --git a/package.json b/package.json index 057175f9c..dca52a16f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vencord", "private": "true", - "version": "1.11.3", + "version": "1.11.4", "description": "The cutest Discord client mod", "homepage": "https://github.com/Vendicated/Vencord#readme", "bugs": { diff --git a/src/api/MemberListDecorators.tsx b/src/api/MemberListDecorators.tsx index 2199f4a6c..ab5a618bf 100644 --- a/src/api/MemberListDecorators.tsx +++ b/src/api/MemberListDecorators.tsx @@ -43,20 +43,21 @@ interface DecoratorProps { export type MemberListDecoratorFactory = (props: DecoratorProps) => JSX.Element | null; type OnlyIn = "guilds" | "dms"; -export const decorators = new Map(); +export const decoratorsFactories = new Map(); export function addMemberListDecorator(identifier: string, render: MemberListDecoratorFactory, onlyIn?: OnlyIn) { - decorators.set(identifier, { render, onlyIn }); + decoratorsFactories.set(identifier, { render, onlyIn }); } export function removeMemberListDecorator(identifier: string) { - decorators.delete(identifier); + decoratorsFactories.delete(identifier); } -export function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] { +export function __getDecorators(props: DecoratorProps): JSX.Element { const isInGuild = !!(props.guildId); - return Array.from( - decorators.entries(), + + const decorators = Array.from( + decoratorsFactories.entries(), ([key, { render: Decorator, onlyIn }]) => { if ((onlyIn === "guilds" && !isInGuild) || (onlyIn === "dms" && isInGuild)) return null; @@ -68,4 +69,10 @@ export function __getDecorators(props: DecoratorProps): (JSX.Element | null)[] { ); } ); + + return ( +
+ {decorators} +
+ ); } diff --git a/src/api/MessageDecorations.tsx b/src/api/MessageDecorations.tsx index 740c95876..1b94c18d9 100644 --- a/src/api/MessageDecorations.tsx +++ b/src/api/MessageDecorations.tsx @@ -48,23 +48,29 @@ export interface MessageDecorationProps { } export type MessageDecorationFactory = (props: MessageDecorationProps) => JSX.Element | null; -export const decorations = new Map(); +export const decorationsFactories = new Map(); export function addMessageDecoration(identifier: string, decoration: MessageDecorationFactory) { - decorations.set(identifier, decoration); + decorationsFactories.set(identifier, decoration); } export function removeMessageDecoration(identifier: string) { - decorations.delete(identifier); + decorationsFactories.delete(identifier); } -export function __addDecorationsToMessage(props: MessageDecorationProps): (JSX.Element | null)[] { - return Array.from( - decorations.entries(), +export function __addDecorationsToMessage(props: MessageDecorationProps): JSX.Element { + const decorations = Array.from( + decorationsFactories.entries(), ([key, Decoration]) => ( ) ); + + return ( +
+ {decorations} +
+ ); } diff --git a/src/components/DonateButton.tsx b/src/components/DonateButton.tsx index c027fcf27..ee2f3ed38 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 (