This commit is contained in:
Mirco Wittrien 2022-09-30 14:18:20 +02:00
parent fe9669b633
commit f43c8cabfe
9 changed files with 14 additions and 14 deletions

View File

@ -4792,7 +4792,7 @@ module.exports = (_ => {
if (openedItem == this.props.id) openedItem = null;
}
render() {
let color = (typeof this.props.color == "string" ? this.props.color : Internal.LibraryComponents.MenuItems.Colors.DEFAULT).toLowerCase();
let color = (typeof this.props.color == "string" ? this.props.color : Internal.DiscordConstants.MenuItemColors.DEFAULT).toLowerCase();
let isCustomColor = false;
if (color) {
if (DiscordClasses[`menu${color}`]) color = color;
@ -4800,7 +4800,7 @@ module.exports = (_ => {
isCustomColor = true;
color = BDFDB.ColorUtils.convert(color, "RGBA");
}
else color = (Internal.LibraryComponents.MenuItems.Colors.DEFAULT || "").toLowerCase();
else color = (Internal.DiscordConstants.MenuItemColors.DEFAULT || "").toLowerCase();
}
let renderPopout, onClose, hasPopout = BDFDB.ObjectUtils.is(this.props.popoutProps);
if (hasPopout) {

View File

@ -232,7 +232,7 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_resetsettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-reset"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
disabled: !changedChannels[e.instance.props.channel.id],
action: event => {
let remove = _ => {

View File

@ -199,7 +199,7 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_resetsettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-reset"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
disabled: !changedRoles[e.instance.props.id],
action: event => {
let remove = _ => {

View File

@ -217,7 +217,7 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_resetsettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-reset"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
disabled: !changedGuilds[e.instance.props.guild.id],
action: event => {
let remove = _ => {

View File

@ -467,7 +467,7 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.submenu_resetsettings,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "settings-reset"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
disabled: !changedUsers[user.id],
action: event => {
let remove = _ => {

View File

@ -154,7 +154,7 @@ module.exports = (_ => {
for (let key in enabledEngines) items.push(BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.defaults.engines[key].name,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "search", key),
color: key == "_all" ? BDFDB.LibraryComponents.MenuItems.Colors.DANGER : BDFDB.LibraryComponents.MenuItems.Colors.DEFAULT,
color: key == "_all" ? BDFDB.DiscordConstants.MenuItemColors.DANGER : BDFDB.DiscordConstants.MenuItemColors.DEFAULT,
persisting: true,
action: event => {
if (!event.shiftKey) BDFDB.ContextMenuUtils.close(e.instance);

View File

@ -929,7 +929,7 @@ module.exports = (_ => {
}) : Object.keys(enabledEngines).map(key => BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.defaults.engines[key].name,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "search", key),
color: key == "_all" ? BDFDB.LibraryComponents.MenuItems.Colors.DANGER : BDFDB.LibraryComponents.MenuItems.Colors.DEFAULT,
color: key == "_all" ? BDFDB.DiscordConstants.MenuItemColors.DANGER : BDFDB.DiscordConstants.MenuItemColors.DEFAULT,
persisting: true,
action: event => {
const open = (url, k) => BDFDB.DiscordUtils.openLink(this.defaults.engines[k].url.replace(imgUrlReplaceString, this.defaults.engines[k].raw ? url : encodeURIComponent(url)), {minimized: event.shiftKey});

View File

@ -281,12 +281,12 @@ module.exports = (_ => {
children: currentCategory ? BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_unpinchannel,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "unpin-channellist"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
action: _ => this.removeFromCategory(id, currentCategory, "channelList")
}) : BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.context_addtonewcategory,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "new-channellist"),
color: BDFDB.LibraryComponents.MenuItems.Colors.BRAND,
color: BDFDB.DiscordConstants.MenuItemColors.BRAND,
action: _ => this.openCategorySettingsModal({
id: this.generateId("channelList"),
name: `${this.labels.header_pinneddms} #${categories.length + 1}`,
@ -312,7 +312,7 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels[pinnedInGuild ? "context_unpinguild" : "context_pinguild"],
id: BDFDB.ContextMenuUtils.createItemId(this.name, pinnedInGuild ? "unpin-serverlist" : "pin-serverlist"),
color: pinnedInGuild ? BDFDB.LibraryComponents.MenuItems.Colors.DANGER : BDFDB.LibraryComponents.MenuItems.Colors.DEFAULT,
color: pinnedInGuild ? BDFDB.DiscordConstants.MenuItemColors.DANGER : BDFDB.DiscordConstants.MenuItemColors.DEFAULT,
action: _ => {
if (!pinnedInGuild) this.addPin(id, "guildList");
else this.removePin(id, "guildList");
@ -525,7 +525,7 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: BDFDB.LanguageUtils.LanguageStrings.DELETE_CATEGORY,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "remove-category"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
action: _ => {
let newData = this.getPinnedChannels("channelList");
delete newData[category.id];

View File

@ -588,7 +588,7 @@ module.exports = (_ => {
BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.serversubmenu_removefromfolder,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "remove-from-folder"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
action: _ => this.removeGuildFromFolder(folder.folderId, e.instance.props.guild.id)
})
] : [
@ -650,7 +650,7 @@ module.exports = (_ => {
children: BDFDB.ContextMenuUtils.createItem(BDFDB.LibraryComponents.MenuItems.MenuItem, {
label: this.labels.foldercontext_removefolder,
id: BDFDB.ContextMenuUtils.createItemId(this.name, "remove-folder"),
color: BDFDB.LibraryComponents.MenuItems.Colors.DANGER,
color: BDFDB.DiscordConstants.MenuItemColors.DANGER,
action: event => {
BDFDB.ModalUtils.confirm(this, this.labels.foldercontext_removefolder_confirm.replace("{{var0}}", folder.folderName ? `"${folder.folderName}"` : "").trim(), _ => {
this.removeFolder(e.instance.props.folderId);