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 { import {
ISettingElementProps, ISettingElementProps,
SettingArrayComponent,
SettingBooleanComponent, SettingBooleanComponent,
SettingCustomComponent, SettingCustomComponent,
SettingListComponent,
SettingNumericComponent, SettingNumericComponent,
SettingSelectComponent, SettingSelectComponent,
SettingSliderComponent, SettingSliderComponent,
@ -83,10 +83,10 @@ const Components: Record<OptionType, React.ComponentType<ISettingElementProps<an
[OptionType.SELECT]: SettingSelectComponent, [OptionType.SELECT]: SettingSelectComponent,
[OptionType.SLIDER]: SettingSliderComponent, [OptionType.SLIDER]: SettingSliderComponent,
[OptionType.COMPONENT]: SettingCustomComponent, [OptionType.COMPONENT]: SettingCustomComponent,
[OptionType.ARRAY]: SettingListComponent, [OptionType.ARRAY]: SettingArrayComponent,
[OptionType.USERS]: SettingListComponent, [OptionType.USERS]: SettingArrayComponent,
[OptionType.CHANNELS]: SettingListComponent, [OptionType.CHANNELS]: SettingArrayComponent,
[OptionType.GUILDS]: SettingListComponent [OptionType.GUILDS]: SettingArrayComponent
}; };
export default function PluginModal({ plugin, onRestartNeeded, onClose, transitionState }: PluginModalProps) { export default function PluginModal({ plugin, onRestartNeeded, onClose, transitionState }: PluginModalProps) {

View file

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

View file

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

View file

@ -10,7 +10,7 @@ import { getIntlMessage } from "@utils/discord";
import definePlugin, { OptionType } from "@utils/types"; import definePlugin, { OptionType } from "@utils/types";
import { Menu, React } from "@webpack/common"; import { Menu, React } from "@webpack/common";
function createContextMenu(name: "Guild" | "User" | "Channel", value: any) { function createContextMenu(name: string, value: any) {
return ( return (
<Menu.MenuItem <Menu.MenuItem
id="vc-plugin-settings" 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 type = name === "Guild" ? OptionType.GUILDS : name === "User" ? OptionType.USERS : OptionType.CHANNELS;
const plugins = registeredPlugins[type]; const plugins = registeredPlugins[type];