1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 09:56:24 +00:00
This commit is contained in:
Elvy 2025-01-03 18:54:51 +01:00
parent 8197966247
commit abdfea15db
4 changed files with 61 additions and 61 deletions

View file

@ -38,9 +38,9 @@ import { PluginMeta } from "~plugins";
import {
ISettingElementProps,
SettingArrayComponent,
SettingBooleanComponent,
SettingCustomComponent,
SettingListComponent,
SettingNumericComponent,
SettingSelectComponent,
SettingSliderComponent,
@ -83,10 +83,10 @@ const Components: Record<OptionType, React.ComponentType<ISettingElementProps<an
[OptionType.SELECT]: SettingSelectComponent,
[OptionType.SLIDER]: SettingSliderComponent,
[OptionType.COMPONENT]: SettingCustomComponent,
[OptionType.ARRAY]: SettingListComponent,
[OptionType.USERS]: SettingListComponent,
[OptionType.CHANNELS]: SettingListComponent,
[OptionType.GUILDS]: SettingListComponent
[OptionType.ARRAY]: SettingArrayComponent,
[OptionType.USERS]: SettingArrayComponent,
[OptionType.CHANNELS]: SettingArrayComponent,
[OptionType.GUILDS]: SettingArrayComponent
};
export default function PluginModal({ plugin, onRestartNeeded, onClose, transitionState }: PluginModalProps) {

View file

@ -48,7 +48,7 @@ interface UserMentionComponentProps {
guildId: string;
}
export function SettingListComponent({
export function SettingArrayComponent({
option,
pluginSettings,
definedSettings,
@ -135,7 +135,7 @@ export function SettingListComponent({
{ background: "none", }
}
>
<CloseIcon/>
<CloseIcon />
</Button>
</Flex>
))}
@ -158,7 +158,7 @@ export function SettingListComponent({
onClick={handleSubmit}
style={{ background: "none" }}
>
<CheckMarkIcon/>
<CheckMarkIcon />
</Button>
</Flex>
</React.Fragment>

View file

@ -33,7 +33,7 @@ export interface ISettingElementProps<T extends PluginOptionBase> {
export * from "../../Badge";
export * from "./SettingBooleanComponent";
export * from "./SettingCustomComponent";
export * from "./SettingListComponent";
export * from "./SettingArrayComponent";
export * from "./SettingNumericComponent";
export * from "./SettingSelectComponent";
export * from "./SettingSliderComponent";

View file

@ -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 (
<Menu.MenuItem
id="vc-plugin-settings"
@ -22,7 +22,7 @@ function createContextMenu(name: "Guild" | "User" | "Channel", value: any) {
}
function renderRegisteredPlugins(name: "Guild" | "User" | "Channel", value: any) {
function renderRegisteredPlugins(name: string, value: any) {
const type = name === "Guild" ? OptionType.GUILDS : name === "User" ? OptionType.USERS : OptionType.CHANNELS;
const plugins = registeredPlugins[type];