Skip to content

Commit

Permalink
Use alternative border radius when previewing a space
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Jul 15, 2021
1 parent 7d2dd5c commit 9caf2ce
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions css/preview.css
Expand Up @@ -22,6 +22,10 @@
height: 64px;
}

.PreviewView .mxSpace .avatar {
border-radius: 12px;
}

.PreviewView .defaultAvatar {
width: 64px;
height: 64px;
Expand Down
2 changes: 1 addition & 1 deletion src/preview/PreviewView.js
Expand Up @@ -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),
Expand Down
2 changes: 2 additions & 0 deletions src/preview/PreviewViewModel.js
Expand Up @@ -34,6 +34,7 @@ export class PreviewViewModel extends ViewModel {
this.topic = null;
this.domain = null;
this.failed = false;
this.isSpaceRoom = false;
}

async load() {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 9caf2ce

Please sign in to comment.