From 9caf2ce268008655f4b4b87d7a46a4d5c0a78875 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 15 Jul 2021 15:36:30 +0100 Subject: [PATCH] Use alternative border radius when previewing a space --- css/preview.css | 4 ++++ src/preview/PreviewView.js | 2 +- src/preview/PreviewViewModel.js | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/css/preview.css b/css/preview.css index 05b569b..aed7111 100644 --- a/css/preview.css +++ b/css/preview.css @@ -22,6 +22,10 @@ height: 64px; } +.PreviewView .mxSpace .avatar { + border-radius: 12px; +} + .PreviewView .defaultAvatar { width: 64px; height: 64px; diff --git a/src/preview/PreviewView.js b/src/preview/PreviewView.js index 0fedfb6..96ed2c2 100644 --- a/src/preview/PreviewView.js +++ b/src/preview/PreviewView.js @@ -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), diff --git a/src/preview/PreviewViewModel.js b/src/preview/PreviewViewModel.js index bc507cc..4599ab2 100644 --- a/src/preview/PreviewViewModel.js +++ b/src/preview/PreviewViewModel.js @@ -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; }