From 1eb2510353cf3ffac9eb746aba8e08d01a54ac06 Mon Sep 17 00:00:00 2001 From: nexpid <60316309+nexpid@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:49:03 +0100 Subject: [PATCH] feat(Decor): Enforce guidelines more (#2035) --- src/plugins/decor/index.tsx | 31 +---- src/plugins/decor/settings.tsx | 47 +++++++ .../decor/ui/modals/ChangeDecorationModal.tsx | 110 ++++++++-------- .../decor/ui/modals/CreateDecorationModal.tsx | 121 +++++++++--------- .../decor/ui/modals/GuidelinesModal.tsx | 68 ++++++++++ src/plugins/decor/ui/styles.css | 4 +- 6 files changed, 242 insertions(+), 139 deletions(-) create mode 100644 src/plugins/decor/settings.tsx create mode 100644 src/plugins/decor/ui/modals/GuidelinesModal.tsx diff --git a/src/plugins/decor/index.tsx b/src/plugins/decor/index.tsx index 4dd7aa0c..ce546d30 100644 --- a/src/plugins/decor/index.tsx +++ b/src/plugins/decor/index.tsx @@ -6,21 +6,17 @@ import "./ui/styles.css"; -import { definePluginSettings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; -import { Link } from "@components/Link"; import { Devs } from "@utils/constants"; -import { Margins } from "@utils/margins"; -import { classes } from "@utils/misc"; -import { closeAllModals } from "@utils/modal"; -import definePlugin, { OptionType } from "@utils/types"; +import definePlugin from "@utils/types"; import { findByPropsLazy } from "@webpack"; -import { FluxDispatcher, Forms, UserStore } from "@webpack/common"; +import { UserStore } from "@webpack/common"; import { CDN_URL, RAW_SKU_ID, SKU_ID } from "./lib/constants"; import { useAuthorizationStore } from "./lib/stores/AuthorizationStore"; import { useCurrentUserDecorationsStore } from "./lib/stores/CurrentUserDecorationsStore"; import { useUserDecorAvatarDecoration, useUsersDecorationsStore } from "./lib/stores/UsersDecorationsStore"; +import { settings } from "./settings"; import { setDecorationGridDecoration, setDecorationGridItem } from "./ui/components"; import DecorSection from "./ui/components/DecorSection"; @@ -30,27 +26,6 @@ export interface AvatarDecoration { skuId: string; } -const settings = definePluginSettings({ - changeDecoration: { - type: OptionType.COMPONENT, - description: "Change your avatar decoration", - component() { - return