Improve component finding api and migrate plugins to use them

This commit is contained in:
Nuckyz 2023-11-22 02:49:08 -03:00
parent 371b5b0be8
commit ffe6512693
No known key found for this signature in database
GPG key ID: 440BF8296E1C4AD9
14 changed files with 89 additions and 57 deletions

View file

@ -11,12 +11,11 @@ import { Devs } from "@utils/constants";
import { getTheme, Theme } from "@utils/discord";
import { Margins } from "@utils/margins";
import { classes } from "@utils/misc";
import { LazyComponent } from "@utils/react";
import { findComponentByCodeLazy } from "@utils/react";
import definePlugin, { OptionType, StartAt } from "@utils/types";
import { findByCode } from "@webpack";
import { Button, Forms } from "@webpack/common";
const ColorPicker = LazyComponent(() => findByCode(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR"));
const ColorPicker = findComponentByCodeLazy(".Messages.USER_SETTINGS_PROFILE_COLOR_SELECT_COLOR");
const colorPresets = [
"#1E1514", "#172019", "#13171B", "#1C1C28", "#402D2D",