Skip to content
Snippets Groups Projects
Commit 7114e5a1 authored by Bruno Windels's avatar Bruno Windels
Browse files

show member count and topic for room preview

parent 173696f4
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,8 @@ export class PreviewView extends TemplateView {
t.p(t.img({className: "avatar", src: vm => vm.avatarUrl})),
t.h1(vm => vm.name),
t.p(vm => vm.identifier),
t.p({className: {hidden: vm => !vm.memberCount}}, [vm => vm.memberCount, " members"]),
t.p({className: {hidden: vm => !vm.topic}}, [vm => vm.topic]),
]),
t.p({className: {hidden: vm => vm.clientsViewModel}}, t.button({
className: "primary fullwidth",
......
......@@ -33,6 +33,8 @@ export class PreviewViewModel extends ViewModel {
this.name = null;
this.avatarUrl = null;
this.identifier = null;
this.memberCount = null;
this.topic = null;
this.previewDomain = null;
this.clientsViewModel = null;
this.acceptInstructions = null;
......@@ -91,7 +93,9 @@ export class PreviewViewModel extends ViewModel {
this.avatarUrl = publicRoom?.avatar_url ?
homeserver.mxcUrlThumbnail(publicRoom.avatar_url, 64, 64, "crop") :
null;
this.identifier = `${publicRoom?.canonical_alias || link.identifier} | ${publicRoom?.num_joined_members} members`;
this.memberCount = publicRoom?.num_joined_members;
this.topic = publicRoom?.topic;
this.identifier = publicRoom?.canonical_alias || link.identifier;
}
get showClientsLabel() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment