From c4a4352b742b7565c8d5066c56b6ce7b755d29e6 Mon Sep 17 00:00:00 2001 From: Mirco Wittrien Date: Tue, 19 May 2020 16:36:11 +0200 Subject: [PATCH] stuff --- Plugins/BDFDB.js | 13 ++++++++++++- .../GoogleTranslateOption.plugin.js | 6 ++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Plugins/BDFDB.js b/Plugins/BDFDB.js index dd4c75e7b7..39e3155028 100644 --- a/Plugins/BDFDB.js +++ b/Plugins/BDFDB.js @@ -7435,17 +7435,28 @@ }; InternalComponents.LibraryComponents.MenuItems = Object.assign({}, BDFDB.ModuleUtils.findByProperties("MenuItem", "MenuGroup")); + InternalComponents.LibraryComponents.MenuItems.MenuHint = InternalBDFDB.loadPatchedComp("MenuItems.MenuHint") || reactInitialized && class BDFDB_MenuHint extends LibraryModules.React.Component { render() { return !this.props.hint ? null : BDFDB.ReactUtils.createElement("div", { className: BDFDB.disCN.menuhint, - children: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, { + children: BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.TextScroller, { children: this.props.hint }) }); } }; + InternalComponents.LibraryComponents.MenuItems.MenuIcon = InternalBDFDB.loadPatchedComp("MenuItems.MenuIcon") || reactInitialized && class BDFDB_MenuIcon extends LibraryModules.React.Component { + render() { + !this.props.icon ? null : return BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.SvgIcon, { + className: BDFDB.disCN.menuicon, + nativeClass: true, + iconSVG: this.props.icon + }); + } + }; + // REMOVE InternalComponents.LibraryComponents.ContextMenuItems = {}; InternalComponents.LibraryComponents.ContextMenuItems.Group = InternalComponents.LibraryComponents.MenuItems.MenuGroup; diff --git a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js index abc46030b4..1feec863c2 100644 --- a/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js +++ b/Plugins/GoogleTranslateOption/GoogleTranslateOption.plugin.js @@ -232,10 +232,8 @@ var GoogleTranslateOption = (_ => { disabled: isTranslating, id: BDFDB.ContextMenuUtils.createItemId(this.name, translated ? "untranslate-message" : "translate-message"), icon: _ => { - return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.SvgIcon, { - className: BDFDB.disCN.menuicon, - nativeClass: true, - iconSVG: translated ? translateIconUntranslate : translateIcon + return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.MenuItems.MenuIcon, { + icon: translated ? translateIconUntranslate : translateIcon }); }, action: _ => {