From ead2a5152f348f91dde2dcca9fd3e235e8869b50 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 25 Oct 2021 11:40:06 +0100 Subject: [PATCH] =?UTF-8?q?Add=20decoration=20to=20space=20hierarchy=20for?= =?UTF-8?q?=20tiles=20which=20have=20already=20been=20j=E2=80=A6=20(#6969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- res/css/structures/_SpaceHierarchy.scss | 22 +++++++++++++++++++- src/components/structures/SpaceHierarchy.tsx | 10 ++++++++- src/i18n/strings/en_EN.json | 1 + 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/res/css/structures/_SpaceHierarchy.scss b/res/css/structures/_SpaceHierarchy.scss index a5d589f9c2..fc7cbf4496 100644 --- a/res/css/structures/_SpaceHierarchy.scss +++ b/res/css/structures/_SpaceHierarchy.scss @@ -203,7 +203,8 @@ limitations under the License. grid-row: 1; grid-column: 2; - .mx_InfoTooltip { + .mx_InfoTooltip, + .mx_SpaceHierarchy_roomTile_joined { display: inline; margin-left: 12px; color: $tertiary-content; @@ -222,6 +223,25 @@ limitations under the License. } } } + + .mx_SpaceHierarchy_roomTile_joined { + position: relative; + padding-left: 16px; + + &::before { + content: ''; + width: 20px; + height: 20px; + top: -2px; + left: -4px; + position: absolute; + mask-position: center; + mask-size: contain; + mask-repeat: no-repeat; + background-color: $accent-color; + mask-image: url('$(res)/img/element-icons/roomlist/checkmark.svg'); + } + } } .mx_SpaceHierarchy_roomTile_info { diff --git a/src/components/structures/SpaceHierarchy.tsx b/src/components/structures/SpaceHierarchy.tsx index c97c984d59..5846ed766d 100644 --- a/src/components/structures/SpaceHierarchy.tsx +++ b/src/components/structures/SpaceHierarchy.tsx @@ -172,8 +172,15 @@ const Tile: React.FC = ({ description += " ยท " + topic; } + let joinedSection; + if (joinedRoom) { + joinedSection =
+ { _t("Joined") } +
; + } + let suggestedSection; - if (suggested) { + if (suggested && (!joinedRoom || hasPermissions)) { suggestedSection = { _t("Suggested") } ; @@ -183,6 +190,7 @@ const Tile: React.FC = ({ { avatar }
{ name } + { joinedSection } { suggestedSection }
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 11d3e44915..7197fd5708 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2927,6 +2927,7 @@ "You have %(count)s unread notifications in a prior version of this room.|other": "You have %(count)s unread notifications in a prior version of this room.", "You have %(count)s unread notifications in a prior version of this room.|one": "You have %(count)s unread notification in a prior version of this room.", "You don't have permission": "You don't have permission", + "Joined": "Joined", "This room is suggested as a good one to join": "This room is suggested as a good one to join", "Suggested": "Suggested", "Select a room below first": "Select a room below first",