show member count and topic for room preview
This commit is contained in:
parent
173696f46e
commit
7114e5a1ef
@ -27,6 +27,8 @@ export class PreviewView extends TemplateView {
|
|||||||
t.p(t.img({className: "avatar", src: vm => vm.avatarUrl})),
|
t.p(t.img({className: "avatar", src: vm => vm.avatarUrl})),
|
||||||
t.h1(vm => vm.name),
|
t.h1(vm => vm.name),
|
||||||
t.p(vm => vm.identifier),
|
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({
|
t.p({className: {hidden: vm => vm.clientsViewModel}}, t.button({
|
||||||
className: "primary fullwidth",
|
className: "primary fullwidth",
|
||||||
|
@ -33,6 +33,8 @@ export class PreviewViewModel extends ViewModel {
|
|||||||
this.name = null;
|
this.name = null;
|
||||||
this.avatarUrl = null;
|
this.avatarUrl = null;
|
||||||
this.identifier = null;
|
this.identifier = null;
|
||||||
|
this.memberCount = null;
|
||||||
|
this.topic = null;
|
||||||
this.previewDomain = null;
|
this.previewDomain = null;
|
||||||
this.clientsViewModel = null;
|
this.clientsViewModel = null;
|
||||||
this.acceptInstructions = null;
|
this.acceptInstructions = null;
|
||||||
@ -91,7 +93,9 @@ export class PreviewViewModel extends ViewModel {
|
|||||||
this.avatarUrl = publicRoom?.avatar_url ?
|
this.avatarUrl = publicRoom?.avatar_url ?
|
||||||
homeserver.mxcUrlThumbnail(publicRoom.avatar_url, 64, 64, "crop") :
|
homeserver.mxcUrlThumbnail(publicRoom.avatar_url, 64, 64, "crop") :
|
||||||
null;
|
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() {
|
get showClientsLabel() {
|
||||||
|
Loading…
Reference in New Issue
Block a user