This commit is contained in:
Mirco Wittrien 2020-01-03 15:23:07 +01:00
parent fc3e84caee
commit e7d6bee4ab
2 changed files with 3 additions and 15 deletions

View File

@ -7816,10 +7816,11 @@
LibraryComponents.SvgIcon = BDFDB.ReactUtils.getValue(window.BDFDB, "LibraryComponents.SvgIcon") || reactInitialized && class BDFDB_Icon extends LibraryModules.React.Component { LibraryComponents.SvgIcon = BDFDB.ReactUtils.getValue(window.BDFDB, "LibraryComponents.SvgIcon") || reactInitialized && class BDFDB_Icon extends LibraryModules.React.Component {
render() { render() {
if (this.props.name && LibraryComponents.SvgIcon[this.props.name]) return BDFDB.ReactUtils.createElement(NativeSubComponents.SvgIcon, this.props); if (this.props.name) return BDFDB.ReactUtils.createElement(NativeSubComponents.SvgIcon, this.props);
else if (this.props.iconSVG) { else if (this.props.iconSVG) {
let icon = BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(this.props.iconSVG)); let icon = BDFDB.ReactUtils.elementToReact(BDFDB.DOMUtils.create(this.props.iconSVG));
icon.props.className = BDFDB.DOMUtils.formatClassName(!icon.props.nativeClass && BDFDB.disCN.svgicon, icon.props.class, this.props.className); icon.props.className = BDFDB.DOMUtils.formatClassName(!icon.props.nativeClass && BDFDB.disCN.svgicon, icon.props.class, this.props.className);
icon.props.style = Object.assign({}, icon.props.style, this.props.style);
return icon; return icon;
} }
return null; return null;
@ -9370,19 +9371,6 @@
InternalBDFDB.patchPlugin(BDFDB); InternalBDFDB.patchPlugin(BDFDB);
InternalBDFDB.patchIconComponent = function (component) {
BDFDB.ModuleUtils.patch(BDFDB, component.prototype, "componentDidMount", {
after: e => {
if (e.thisObject.props && e.thisObject.props.style && e.thisObject.props.style.color) {
let node = BDFDB.ReactUtils.findDOMNode(e.thisObject);
if (node) node.style.setProperty("color", e.thisObject.props.style.color);
}
}
});
}
if (LibraryComponents.HeaderBarComponents && LibraryComponents.HeaderBarComponents.Icon) InternalBDFDB.patchIconComponent(LibraryComponents.HeaderBarComponents.Icon);
if (NativeSubComponents.SvgIcon) InternalBDFDB.patchIconComponent(NativeSubComponents.SvgIcon);
if (LibraryComponents.GuildComponents.BlobMask) { if (LibraryComponents.GuildComponents.BlobMask) {
let newBadges = ["lowerLeftBadge", "upperLeftBadge"]; let newBadges = ["lowerLeftBadge", "upperLeftBadge"];
BDFDB.ModuleUtils.patch(BDFDB, LibraryComponents.GuildComponents.BlobMask.prototype, "render", { BDFDB.ModuleUtils.patch(BDFDB, LibraryComponents.GuildComponents.BlobMask.prototype, "render", {

File diff suppressed because one or more lines are too long