refactor Settings UI (#3545)
Much improved file structure and cleaner code. Also gets rid of temporary settings & saving and instead applies all changes immediately. Besides that, this change only changes code and doesn't change the ui
This commit is contained in:
parent
a33e81d1cb
commit
3f51ee1b2a
94 changed files with 2120 additions and 2002 deletions
|
|
@ -17,14 +17,13 @@
|
|||
*/
|
||||
|
||||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { Devs, IS_MAC } from "@utils/constants";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { Message } from "@vencord/discord-types";
|
||||
import { ChannelStore, ComponentDispatch, FluxDispatcher as Dispatcher, MessageActions, MessageStore, PermissionsBits, PermissionStore, SelectedChannelStore, UserStore } from "@webpack/common";
|
||||
import NoBlockedMessagesPlugin from "plugins/noBlockedMessages";
|
||||
import NoReplyMentionPlugin from "plugins/noReplyMention";
|
||||
|
||||
const isMac = navigator.platform.includes("Mac"); // bruh
|
||||
let currentlyReplyingId: string | null = null;
|
||||
let currentlyEditingId: string | null = null;
|
||||
|
||||
|
|
@ -91,8 +90,8 @@ function onCreatePendingReply({ message, _isQuickReply }: { message: Message; _i
|
|||
currentlyReplyingId = message.id;
|
||||
}
|
||||
|
||||
const isCtrl = (e: KeyboardEvent) => isMac ? e.metaKey : e.ctrlKey;
|
||||
const isAltOrMeta = (e: KeyboardEvent) => e.altKey || (!isMac && e.metaKey);
|
||||
const isCtrl = (e: KeyboardEvent) => IS_MAC ? e.metaKey : e.ctrlKey;
|
||||
const isAltOrMeta = (e: KeyboardEvent) => e.altKey || (!IS_MAC && e.metaKey);
|
||||
|
||||
function onKeydown(e: KeyboardEvent) {
|
||||
const isUp = e.key === "ArrowUp";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue