Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit ead2a51

Browse files
authored
Add decoration to space hierarchy for tiles which have already been j… (#6969)
1 parent fabbf6c commit ead2a51

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

res/css/structures/_SpaceHierarchy.scss

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ limitations under the License.
203203
grid-row: 1;
204204
grid-column: 2;
205205

206-
.mx_InfoTooltip {
206+
.mx_InfoTooltip,
207+
.mx_SpaceHierarchy_roomTile_joined {
207208
display: inline;
208209
margin-left: 12px;
209210
color: $tertiary-content;
@@ -222,6 +223,25 @@ limitations under the License.
222223
}
223224
}
224225
}
226+
227+
.mx_SpaceHierarchy_roomTile_joined {
228+
position: relative;
229+
padding-left: 16px;
230+
231+
&::before {
232+
content: '';
233+
width: 20px;
234+
height: 20px;
235+
top: -2px;
236+
left: -4px;
237+
position: absolute;
238+
mask-position: center;
239+
mask-size: contain;
240+
mask-repeat: no-repeat;
241+
background-color: $accent-color;
242+
mask-image: url('$(res)/img/element-icons/roomlist/checkmark.svg');
243+
}
244+
}
225245
}
226246

227247
.mx_SpaceHierarchy_roomTile_info {

src/components/structures/SpaceHierarchy.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,15 @@ const Tile: React.FC<ITileProps> = ({
172172
description += " · " + topic;
173173
}
174174

175+
let joinedSection;
176+
if (joinedRoom) {
177+
joinedSection = <div className="mx_SpaceHierarchy_roomTile_joined">
178+
{ _t("Joined") }
179+
</div>;
180+
}
181+
175182
let suggestedSection;
176-
if (suggested) {
183+
if (suggested && (!joinedRoom || hasPermissions)) {
177184
suggestedSection = <InfoTooltip tooltip={_t("This room is suggested as a good one to join")}>
178185
{ _t("Suggested") }
179186
</InfoTooltip>;
@@ -183,6 +190,7 @@ const Tile: React.FC<ITileProps> = ({
183190
{ avatar }
184191
<div className="mx_SpaceHierarchy_roomTile_name">
185192
{ name }
193+
{ joinedSection }
186194
{ suggestedSection }
187195
</div>
188196

src/i18n/strings/en_EN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,6 +2927,7 @@
29272927
"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.",
29282928
"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.",
29292929
"You don't have permission": "You don't have permission",
2930+
"Joined": "Joined",
29302931
"This room is suggested as a good one to join": "This room is suggested as a good one to join",
29312932
"Suggested": "Suggested",
29322933
"Select a room below first": "Select a room below first",

0 commit comments

Comments
 (0)