Merge pull request #447 from MidhunSureshR/avatar-memberlist-link
Link to member-panel from avatar
This commit is contained in:
commit
5675895301
3 changed files with 7 additions and 1 deletions
|
@ -41,6 +41,10 @@ export class BaseMessageTile extends SimpleTile {
|
|||
return this._entry.sender;
|
||||
}
|
||||
|
||||
get memberPanelLink() {
|
||||
return `${this.urlCreator.urlUntilSegment("room")}/member/${this.sender}`;
|
||||
}
|
||||
|
||||
// Avatar view model contract
|
||||
get avatarColorNumber() {
|
||||
return getIdentifierColorNumber(this._entry.sender);
|
||||
|
|
|
@ -64,6 +64,7 @@ limitations under the License.
|
|||
|
||||
.Timeline_messageAvatar {
|
||||
grid-area: avatar;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.Timeline_messageSender {
|
||||
|
|
|
@ -42,6 +42,7 @@ export class BaseMessageView extends TemplateView {
|
|||
// should be after body as it is overlayed on top
|
||||
t.button({className: "Timeline_messageOptions"}, "⋯"),
|
||||
]);
|
||||
const avatar = t.a({href: vm.memberPanelLink, className: "Timeline_messageAvatar"}, [renderStaticAvatar(vm, 30)]);
|
||||
// given that there can be many tiles, we don't add
|
||||
// unneeded DOM nodes in case of a continuation, and we add it
|
||||
// with a side-effect binding to not have to create sub views,
|
||||
|
@ -52,7 +53,7 @@ export class BaseMessageView extends TemplateView {
|
|||
li.removeChild(li.querySelector(".Timeline_messageAvatar"));
|
||||
li.removeChild(li.querySelector(".Timeline_messageSender"));
|
||||
} else if (!isContinuation) {
|
||||
li.insertBefore(renderStaticAvatar(vm, 30, "Timeline_messageAvatar"), li.firstChild);
|
||||
li.insertBefore(avatar, li.firstChild);
|
||||
li.insertBefore(tag.div({className: `Timeline_messageSender usercolor${vm.avatarColorNumber}`}, vm.displayName), li.firstChild);
|
||||
}
|
||||
});
|
||||
|
|
Reference in a new issue