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

Commit d74e9c4

Browse files
committed
Remove impossible space hierarchy size string
1 parent 1c2dc13 commit d74e9c4

File tree

3 files changed

+9
-17
lines changed

3 files changed

+9
-17
lines changed

res/css/structures/_SpaceHierarchy.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ limitations under the License.
7070
font-size: $font-15px;
7171
line-height: $font-24px;
7272
color: $primary-fg-color;
73+
margin-bottom: 12px;
74+
75+
> h4 {
76+
font-weight: $font-semi-bold;
77+
margin: 0;
78+
}
7379

7480
.mx_AccessibleButton {
7581
padding: 4px 12px;

src/components/structures/SpaceHierarchy.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -444,18 +444,6 @@ const SpaceHierarchy = ({
444444
if (loading) {
445445
content = <Spinner />;
446446
} else {
447-
const numRooms = Array.from(filteredRoomSet).filter(r => !r.room_type).length;
448-
const numSpaces = filteredRoomSet.size - numRooms - 1; // -1 at the end to exclude the space we are looking at
449-
450-
let countsStr;
451-
if (numSpaces > 1) {
452-
countsStr = _t("%(count)s rooms and %(numSpaces)s spaces", { count: numRooms, numSpaces });
453-
} else if (numSpaces > 0) {
454-
countsStr = _t("%(count)s rooms and 1 space", { count: numRooms, numSpaces });
455-
} else {
456-
countsStr = _t("%(count)s rooms", { count: numRooms, numSpaces });
457-
}
458-
459447
let manageButtons;
460448
if (space.getMyMembership() === "join" && space.currentState.maySendStateEvent(EventType.SpaceChild, userId)) {
461449
const selectedRelations = Array.from(selected.keys()).flatMap(parentId => {
@@ -582,7 +570,7 @@ const SpaceHierarchy = ({
582570

583571
content = <>
584572
<div className="mx_SpaceHierarchy_listHeader">
585-
{ countsStr }
573+
<h4>{ query.trim() ? _t("Results") : _t("Rooms and spaces") }</h4>
586574
<span>
587575
{ additionalButtons }
588576
{ manageButtons }

src/i18n/strings/en_EN.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,17 +2811,15 @@
28112811
"This room is suggested as a good one to join": "This room is suggested as a good one to join",
28122812
"Suggested": "Suggested",
28132813
"Your server does not support showing space hierarchies.": "Your server does not support showing space hierarchies.",
2814-
"%(count)s rooms and %(numSpaces)s spaces|other": "%(count)s rooms and %(numSpaces)s spaces",
2815-
"%(count)s rooms and %(numSpaces)s spaces|one": "%(count)s room and %(numSpaces)s spaces",
2816-
"%(count)s rooms and 1 space|other": "%(count)s rooms and 1 space",
2817-
"%(count)s rooms and 1 space|one": "%(count)s room and 1 space",
28182814
"Select a room below first": "Select a room below first",
28192815
"Failed to remove some rooms. Try again later": "Failed to remove some rooms. Try again later",
28202816
"Removing...": "Removing...",
28212817
"Mark as not suggested": "Mark as not suggested",
28222818
"Mark as suggested": "Mark as suggested",
28232819
"No results found": "No results found",
28242820
"You may want to try a different search or check for typos.": "You may want to try a different search or check for typos.",
2821+
"Results": "Results",
2822+
"Rooms and spaces": "Rooms and spaces",
28252823
"Search names and descriptions": "Search names and descriptions",
28262824
"Private space": "Private space",
28272825
"<inviter/> invites you": "<inviter/> invites you",

0 commit comments

Comments
 (0)