This commit is contained in:
Mirco Wittrien 2020-07-20 10:46:49 +02:00
parent 8ffa1ae778
commit 9047f850bd
5 changed files with 14 additions and 12 deletions

View File

@ -6647,7 +6647,9 @@
InternalComponents.LibraryComponents.AutocompleteMenu = BDFDB.ModuleUtils.findByName("Autocomplete");
InternalComponents.LibraryComponents.Avatar = (BDFDB.ModuleUtils.findByProperties("AnimatedAvatar") || {}).default;
let AvatarComponents = BDFDB.ModuleUtils.findByProperties("AnimatedAvatar") || {};
InternalComponents.LibraryComponents.Avatar = AvatarComponents.default;
InternalComponents.LibraryComponents.AvatarComponents = AvatarComponents;
InternalComponents.LibraryComponents.BadgeAnimationContainer = InternalBDFDB.loadPatchedComp("BadgeAnimationContainer") || reactInitialized && class BDFDB_BadgeAnimationContainer extends LibraryModules.React.Component {
componentDidMount() {BDFDB.ReactUtils.forceUpdate(this);}
@ -9941,9 +9943,9 @@
InternalBDFDB._processAvatarRender = function (user, avatar) {
if (BDFDB.ReactUtils.isValidElement(avatar) && BDFDB.ObjectUtils.is(user)) {
let changed = false;
if (avatar.type == "img") avatar = BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.Avatar, Object.assign({}, avatar.props, {
if (avatar.type == "img") avatar = BDFDB.ReactUtils.createElement(InternalComponents.LibraryComponents.AvatarComponents.default, Object.assign({}, avatar.props, {
className: BDFDB.DOMUtils.formatClassName((avatar.props.className || "").replace(BDFDB.disCN.avatar, "")),
size: InternalComponents.LibraryComponents.Avatar.Sizes.SIZE_40
size: InternalComponents.LibraryComponents.AvatarComponents.Sizes.SIZE_40
}));
avatar.props["user_by_BDFDB"] = user.id;
if (BDFDB_Patrons_T2.includes(user.id)) {

File diff suppressed because one or more lines are too long

View File

@ -167,9 +167,9 @@ var DisplayServersAsChannels = (_ => {
this.removeTooltip(e.returnvalue);
this.removeMask(e.returnvalue);
this.addElementName(e.returnvalue, text, {
badges: icon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatar, {
badges: icon && BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
src: icon,
size: BDFDB.LibraryComponents.Avatar.Sizes.SIZE_24
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_24
})
});
}

View File

@ -193,11 +193,11 @@ var FriendNotifications = (_ => {
amount: 50
},
renderLabel: data => [
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatar, {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
className: BDFDB.DOMUtils.formatClassName("settings-avatar", data.disabled && "disabled", data.destop && "desktop"),
src: BDFDB.UserUtils.getAvatar(data.id),
status: BDFDB.UserUtils.getStatus(data.id),
size: BDFDB.LibraryComponents.Avatar.Sizes.SIZE_40,
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_40,
onClick: (e, instance) => {
changeNotificationType(type, data.id, false, !(data.disabled || data.desktop));
},
@ -652,11 +652,11 @@ var FriendNotifications = (_ => {
className: "log-time",
children: `[${log.timestring}]`
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatar, {
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
className: "log-user",
src: log.avatar,
status: log.status,
size: BDFDB.LibraryComponents.Avatar.Sizes.SIZE_40
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_40
}),
BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.TextScroller, {
className: "log-content",

View File

@ -37,11 +37,11 @@ var ShowHiddenChannels = (_ => {
}
render() {
return BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.ListRow, {
prefix: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.Avatar, {
prefix: BDFDB.ReactUtils.createElement(BDFDB.LibraryComponents.AvatarComponents.default, {
className: BDFDB.disCN.listavatar,
src: BDFDB.UserUtils.getAvatar(this.props.user.id),
status: BDFDB.UserUtils.getStatus(this.props.user.id),
size: BDFDB.LibraryComponents.Avatar.Sizes.SIZE_40
size: BDFDB.LibraryComponents.AvatarComponents.Sizes.SIZE_40
}),
label: [
BDFDB.ReactUtils.createElement("span", {