Use alternative border radius when previewing a space

This commit is contained in:
Michael Telatynski 2021-07-15 15:36:30 +01:00
parent 7d2dd5cc68
commit 9caf2ce268
3 changed files with 7 additions and 1 deletions

View file

@ -22,6 +22,10 @@
height: 64px;
}
.PreviewView .mxSpace .avatar {
border-radius: 12px;
}
.PreviewView .defaultAvatar {
width: 64px;
height: 64px;

View file

@ -51,7 +51,7 @@ class LoadedPreviewView extends TemplateView {
return t.div({className: "defaultAvatar"});
}
});
return t.div([
return t.div({className: vm.isSpaceRoom ? "mxSpace" : undefined}, [
t.div({className: "avatarContainer"}, avatar),
t.h1(vm => vm.name),
t.p({className: {identifier: true, hidden: vm => !vm.identifier}}, vm => vm.identifier),

View file

@ -34,6 +34,7 @@ export class PreviewViewModel extends ViewModel {
this.topic = null;
this.domain = null;
this.failed = false;
this.isSpaceRoom = false;
}
async load() {
@ -110,6 +111,7 @@ export class PreviewViewModel extends ViewModel {
this.memberCount = publicRoom?.num_joined_members;
this.topic = publicRoom?.topic;
this.identifier = publicRoom?.canonical_alias || link.identifier;
this.isSpaceRoom = publicRoom?.room_type === "m.space";
if (this.identifier === this.name) {
this.identifier = null;
}