Decor: only search for DecorationModalStyles once
This commit is contained in:
parent
1eb2510353
commit
4a1c85c8ad
|
@ -5,9 +5,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { classNameFactory } from "@api/Styles";
|
import { classNameFactory } from "@api/Styles";
|
||||||
import { extractAndLoadChunksLazy } from "@webpack";
|
import { extractAndLoadChunksLazy, findByPropsLazy } from "@webpack";
|
||||||
|
|
||||||
export const cl = classNameFactory("vc-decor-");
|
export const cl = classNameFactory("vc-decor-");
|
||||||
|
export const DecorationModalStyles = findByPropsLazy("modalFooterShopButton");
|
||||||
|
|
||||||
export const requireAvatarDecorationModal = extractAndLoadChunksLazy(["openAvatarDecorationModal:"]);
|
export const requireAvatarDecorationModal = extractAndLoadChunksLazy(["openAvatarDecorationModal:"]);
|
||||||
export const requireCreateStickerModal = extractAndLoadChunksLazy(["stickerInspected]:"]);
|
export const requireCreateStickerModal = extractAndLoadChunksLazy(["stickerInspected]:"]);
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { openInviteModal } from "@utils/discord";
|
||||||
import { Margins } from "@utils/margins";
|
import { Margins } from "@utils/margins";
|
||||||
import { classes } from "@utils/misc";
|
import { classes } from "@utils/misc";
|
||||||
import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||||
import { findByPropsLazy, findComponentByCodeLazy } from "@webpack";
|
import { findComponentByCodeLazy } from "@webpack";
|
||||||
import { Alerts, Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Parser, Text, Tooltip, useEffect, UserStore, UserUtils, useState } from "@webpack/common";
|
import { Alerts, Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Parser, Text, Tooltip, useEffect, UserStore, UserUtils, useState } from "@webpack/common";
|
||||||
import { User } from "discord-types/general";
|
import { User } from "discord-types/general";
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ import { useAuthorizationStore } from "../../lib/stores/AuthorizationStore";
|
||||||
import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDecorationsStore";
|
import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDecorationsStore";
|
||||||
import { decorationToAvatarDecoration } from "../../lib/utils/decoration";
|
import { decorationToAvatarDecoration } from "../../lib/utils/decoration";
|
||||||
import { settings } from "../../settings";
|
import { settings } from "../../settings";
|
||||||
import { cl, requireAvatarDecorationModal } from "../";
|
import { cl, DecorationModalStyles, requireAvatarDecorationModal } from "../";
|
||||||
import { AvatarDecorationModalPreview } from "../components";
|
import { AvatarDecorationModalPreview } from "../components";
|
||||||
import DecorationGridCreate from "../components/DecorationGridCreate";
|
import DecorationGridCreate from "../components/DecorationGridCreate";
|
||||||
import DecorationGridNone from "../components/DecorationGridNone";
|
import DecorationGridNone from "../components/DecorationGridNone";
|
||||||
|
@ -30,7 +30,6 @@ import { openCreateDecorationModal } from "./CreateDecorationModal";
|
||||||
import { openGuidelinesModal } from "./GuidelinesModal";
|
import { openGuidelinesModal } from "./GuidelinesModal";
|
||||||
|
|
||||||
const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers");
|
const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers");
|
||||||
const DecorationModalStyles = findByPropsLazy("modalFooterShopButton");
|
|
||||||
|
|
||||||
function usePresets() {
|
function usePresets() {
|
||||||
const [presets, setPresets] = useState<Preset[]>([]);
|
const [presets, setPresets] = useState<Preset[]>([]);
|
||||||
|
|
|
@ -14,12 +14,9 @@ import { Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Text, Text
|
||||||
|
|
||||||
import { GUILD_ID, INVITE_KEY, RAW_SKU_ID } from "../../lib/constants";
|
import { GUILD_ID, INVITE_KEY, RAW_SKU_ID } from "../../lib/constants";
|
||||||
import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDecorationsStore";
|
import { useCurrentUserDecorationsStore } from "../../lib/stores/CurrentUserDecorationsStore";
|
||||||
import { cl, requireAvatarDecorationModal, requireCreateStickerModal } from "../";
|
import { cl, DecorationModalStyles, requireAvatarDecorationModal, requireCreateStickerModal } from "../";
|
||||||
import { AvatarDecorationModalPreview } from "../components";
|
import { AvatarDecorationModalPreview } from "../components";
|
||||||
|
|
||||||
|
|
||||||
const DecorationModalStyles = findByPropsLazy("modalFooterShopButton");
|
|
||||||
|
|
||||||
const FileUpload = findComponentByCodeLazy("fileUploadInput,");
|
const FileUpload = findComponentByCodeLazy("fileUploadInput,");
|
||||||
|
|
||||||
const { default: HelpMessage, HelpMessageTypes } = findByPropsLazy("HelpMessageTypes");
|
const { default: HelpMessage, HelpMessageTypes } = findByPropsLazy("HelpMessageTypes");
|
||||||
|
|
|
@ -6,15 +6,12 @@
|
||||||
|
|
||||||
import { Link } from "@components/Link";
|
import { Link } from "@components/Link";
|
||||||
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
import { ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal";
|
||||||
import { findByPropsLazy } from "@webpack";
|
|
||||||
import { Button, Forms, Text } from "@webpack/common";
|
import { Button, Forms, Text } from "@webpack/common";
|
||||||
|
|
||||||
import { settings } from "../../settings";
|
import { settings } from "../../settings";
|
||||||
import { cl, requireAvatarDecorationModal } from "../";
|
import { cl, DecorationModalStyles, requireAvatarDecorationModal } from "../";
|
||||||
import { openCreateDecorationModal } from "./CreateDecorationModal";
|
import { openCreateDecorationModal } from "./CreateDecorationModal";
|
||||||
|
|
||||||
const DecorationModalStyles = findByPropsLazy("modalFooterShopButton");
|
|
||||||
|
|
||||||
function GuidelinesModal(props: ModalProps) {
|
function GuidelinesModal(props: ModalProps) {
|
||||||
return <ModalRoot
|
return <ModalRoot
|
||||||
{...props}
|
{...props}
|
||||||
|
|
Loading…
Reference in a new issue