From abdfea15db073648b0f702c8a3ce284a723bb677 Mon Sep 17 00:00:00 2001 From: Elvy <88881326+EepyElvyra@users.noreply.github.com> Date: Fri, 3 Jan 2025 18:54:51 +0100 Subject: [PATCH] rename --- src/components/PluginSettings/PluginModal.tsx | 10 +- ...omponent.tsx => SettingArrayComponent.tsx} | 104 +++++++++--------- .../PluginSettings/components/index.ts | 2 +- src/plugins/_api/settingArrays.tsx | 6 +- 4 files changed, 61 insertions(+), 61 deletions(-) rename src/components/PluginSettings/components/{SettingListComponent.tsx => SettingArrayComponent.tsx} (61%) diff --git a/src/components/PluginSettings/PluginModal.tsx b/src/components/PluginSettings/PluginModal.tsx index 64dad2a70..abf0ada8d 100644 --- a/src/components/PluginSettings/PluginModal.tsx +++ b/src/components/PluginSettings/PluginModal.tsx @@ -38,9 +38,9 @@ import { PluginMeta } from "~plugins"; import { ISettingElementProps, + SettingArrayComponent, SettingBooleanComponent, SettingCustomComponent, - SettingListComponent, SettingNumericComponent, SettingSelectComponent, SettingSliderComponent, @@ -83,10 +83,10 @@ const Components: Record {items.map((item, index) => ( - + {option.type === OptionType.USERS ? ( + + ) : option.type === OptionType.CHANNELS ? ( + {wrapChannel(item)} + ) : option.type === OptionType.GUILDS ? ( + + {GuildStore.getGuild(item)?.name || "Unknown Guild"} + + // TODO add logo to guild and channel? + ) : ( + {item} + )} + + + ))} - - {/* Add a single input field */} - - {/* Add a submit button */} - - + + {/* Add a single input field */} + + {/* Add a submit button */} + + diff --git a/src/components/PluginSettings/components/index.ts b/src/components/PluginSettings/components/index.ts index d87f9d21a..ac3f82975 100644 --- a/src/components/PluginSettings/components/index.ts +++ b/src/components/PluginSettings/components/index.ts @@ -33,7 +33,7 @@ export interface ISettingElementProps { export * from "../../Badge"; export * from "./SettingBooleanComponent"; export * from "./SettingCustomComponent"; -export * from "./SettingListComponent"; +export * from "./SettingArrayComponent"; export * from "./SettingNumericComponent"; export * from "./SettingSelectComponent"; export * from "./SettingSliderComponent"; diff --git a/src/plugins/_api/settingArrays.tsx b/src/plugins/_api/settingArrays.tsx index 0c98022dd..bd990d13b 100644 --- a/src/plugins/_api/settingArrays.tsx +++ b/src/plugins/_api/settingArrays.tsx @@ -10,7 +10,7 @@ import { getIntlMessage } from "@utils/discord"; import definePlugin, { OptionType } from "@utils/types"; import { Menu, React } from "@webpack/common"; -function createContextMenu(name: "Guild" | "User" | "Channel", value: any) { +function createContextMenu(name: string, value: any) { return (