Skip to content

Commit 737cd4f

Browse files
committed
refactor: rename RoomListHeader as LegacyRoomListHeader
1 parent 073d8e0 commit 737cd4f

6 files changed

Lines changed: 33 additions & 33 deletions

File tree

res/css/_components.pcss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
@import "./views/rooms/_IRCLayout.pcss";
289289
@import "./views/rooms/_InvitedIconView.pcss";
290290
@import "./views/rooms/_JumpToBottomButton.pcss";
291+
@import "./views/rooms/_LegacyRoomListHeader.pcss";
291292
@import "./views/rooms/_LinkPreviewGroup.pcss";
292293
@import "./views/rooms/_LinkPreviewWidget.pcss";
293294
@import "./views/rooms/_LiveContentSummary.pcss";
@@ -312,7 +313,6 @@
312313
@import "./views/rooms/_RoomInfoLine.pcss";
313314
@import "./views/rooms/_RoomKnocksBar.pcss";
314315
@import "./views/rooms/_RoomList.pcss";
315-
@import "./views/rooms/_RoomListHeader.pcss";
316316
@import "./views/rooms/_RoomPreviewBar.pcss";
317317
@import "./views/rooms/_RoomPreviewCard.pcss";
318318
@import "./views/rooms/_RoomSearchAuxPanel.pcss";

res/css/structures/_LeftPanel.pcss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Please see LICENSE files in the repository root for full details.
113113
display: flex;
114114
align-items: center;
115115

116-
& + .mx_RoomListHeader {
116+
& + .mx_LegacyRoomListHeader {
117117
margin-top: 12px;
118118
}
119119

@@ -180,7 +180,7 @@ Please see LICENSE files in the repository root for full details.
180180
}
181181
}
182182

183-
.mx_RoomListHeader:first-child {
183+
.mx_LegacyRoomListHeader:first-child {
184184
margin-top: 12px;
185185
}
186186

res/css/views/rooms/_RoomListHeader.pcss renamed to res/css/views/rooms/_LegacyRoomListHeader.pcss

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Com
66
Please see LICENSE files in the repository root for full details.
77
*/
88

9-
.mx_RoomListHeader {
9+
.mx_LegacyRoomListHeader {
1010
display: flex;
1111
align-items: center;
1212

13-
.mx_RoomListHeader_contextLessTitle,
14-
.mx_RoomListHeader_contextMenuButton {
13+
.mx_LegacyRoomListHeader_contextLessTitle,
14+
.mx_LegacyRoomListHeader_contextMenuButton {
1515
font: var(--cpd-font-heading-sm-semibold);
1616
font-weight: var(--cpd-font-weight-semibold);
1717
padding: 1px 24px 1px 4px;
@@ -24,7 +24,7 @@ Please see LICENSE files in the repository root for full details.
2424
user-select: none;
2525
}
2626

27-
.mx_RoomListHeader_contextMenuButton {
27+
.mx_LegacyRoomListHeader_contextMenuButton {
2828
border-radius: 6px;
2929

3030
&:hover {
@@ -54,7 +54,7 @@ Please see LICENSE files in the repository root for full details.
5454
}
5555
}
5656

57-
.mx_RoomListHeader_plusButton {
57+
.mx_LegacyRoomListHeader_plusButton {
5858
width: 32px;
5959
height: 32px;
6060
border-radius: 8px;
@@ -88,21 +88,21 @@ Please see LICENSE files in the repository root for full details.
8888
}
8989
}
9090

91-
.mx_RoomListHeader_iconInvite::before {
91+
.mx_LegacyRoomListHeader_iconInvite::before {
9292
mask-image: url("$(res)/img/element-icons/room/invite.svg");
9393
}
94-
.mx_RoomListHeader_iconStartChat::before {
94+
.mx_LegacyRoomListHeader_iconStartChat::before {
9595
mask-image: url("@vector-im/compound-design-tokens/icons/user-add-solid.svg");
9696
}
97-
.mx_RoomListHeader_iconNewRoom::before {
97+
.mx_LegacyRoomListHeader_iconNewRoom::before {
9898
mask-image: url("$(res)/img/element-icons/roomlist/hash-plus.svg");
9999
}
100-
.mx_RoomListHeader_iconNewVideoRoom::before {
100+
.mx_LegacyRoomListHeader_iconNewVideoRoom::before {
101101
mask-image: url("$(res)/img/element-icons/roomlist/hash-video.svg");
102102
}
103-
.mx_RoomListHeader_iconExplore::before {
103+
.mx_LegacyRoomListHeader_iconExplore::before {
104104
mask-image: url("$(res)/img/element-icons/roomlist/hash-search.svg");
105105
}
106-
.mx_RoomListHeader_iconPlus::before {
106+
.mx_LegacyRoomListHeader_iconPlus::before {
107107
mask-image: url("@vector-im/compound-design-tokens/icons/plus.svg");
108108
}

src/components/structures/LeftPanel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { MetaSpace, type SpaceKey, UPDATE_SELECTED_SPACE } from "../../stores/sp
2323
import { getKeyBindingsManager } from "../../KeyBindingsManager";
2424
import UIStore from "../../stores/UIStore";
2525
import { type IState as IRovingTabIndexState } from "../../accessibility/RovingTabIndex";
26-
import RoomListHeader from "../views/rooms/RoomListHeader";
26+
import LegacyRoomListHeader from "../views/rooms/LegacyRoomListHeader";
2727
import { BreadcrumbsStore } from "../../stores/BreadcrumbsStore";
2828
import RoomListStore, { LISTS_UPDATE_EVENT } from "../../stores/room-list/RoomListStore";
2929
import { UPDATE_EVENT } from "../../stores/AsyncStore";
@@ -415,7 +415,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
415415
<div className="mx_LeftPanel_roomListContainer">
416416
{shouldShowComponent(UIComponent.FilterContainer) && this.renderSearchDialExplore()}
417417
{this.renderBreadcrumbs()}
418-
{!this.props.isMinimized && <RoomListHeader onVisibilityChange={this.refreshStickyHeaders} />}
418+
{!this.props.isMinimized && <LegacyRoomListHeader onVisibilityChange={this.refreshStickyHeaders} />}
419419
<nav className="mx_LeftPanel_roomListWrapper" aria-label={_t("common|rooms")}>
420420
<div
421421
className={roomListClasses}

src/components/views/rooms/RoomListHeader.tsx renamed to src/components/views/rooms/LegacyRoomListHeader.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ interface IProps {
108108
onVisibilityChange?(): void;
109109
}
110110

111-
const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
111+
const LegacyRoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
112112
const cli = useContext(MatrixClientContext);
113113
const [mainMenuDisplayed, mainMenuHandle, openMainMenu, closeMainMenu] = useContextMenu<HTMLDivElement>();
114114
const [plusMenuDisplayed, plusMenuHandle, openPlusMenu, closePlusMenu] = useContextMenu<HTMLDivElement>();
@@ -178,7 +178,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
178178
inviteOption = (
179179
<IconizedContextMenuOption
180180
label={_t("action|invite")}
181-
iconClassName="mx_RoomListHeader_iconInvite"
181+
iconClassName="mx_LegacyRoomListHeader_iconInvite"
182182
onClick={(e) => {
183183
e.preventDefault();
184184
e.stopPropagation();
@@ -194,7 +194,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
194194
newRoomOptions = (
195195
<>
196196
<IconizedContextMenuOption
197-
iconClassName="mx_RoomListHeader_iconNewRoom"
197+
iconClassName="mx_LegacyRoomListHeader_iconNewRoom"
198198
label={_t("action|new_room")}
199199
onClick={(e) => {
200200
e.preventDefault();
@@ -206,7 +206,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
206206
/>
207207
{videoRoomsEnabled && (
208208
<IconizedContextMenuOption
209-
iconClassName="mx_RoomListHeader_iconNewVideoRoom"
209+
iconClassName="mx_LegacyRoomListHeader_iconNewVideoRoom"
210210
label={_t("action|new_video_room")}
211211
onClick={(e) => {
212212
e.preventDefault();
@@ -236,7 +236,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
236236
{newRoomOptions}
237237
<IconizedContextMenuOption
238238
label={_t("action|explore_rooms")}
239-
iconClassName="mx_RoomListHeader_iconExplore"
239+
iconClassName="mx_LegacyRoomListHeader_iconExplore"
240240
onClick={(e) => {
241241
e.preventDefault();
242242
e.stopPropagation();
@@ -251,7 +251,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
251251
/>
252252
<IconizedContextMenuOption
253253
label={_t("action|add_existing_room")}
254-
iconClassName="mx_RoomListHeader_iconPlus"
254+
iconClassName="mx_LegacyRoomListHeader_iconPlus"
255255
onClick={(e) => {
256256
e.preventDefault();
257257
e.stopPropagation();
@@ -264,7 +264,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
264264
{canCreateSpaces && (
265265
<IconizedContextMenuOption
266266
label={_t("room_list|add_space_label")}
267-
iconClassName="mx_RoomListHeader_iconPlus"
267+
iconClassName="mx_LegacyRoomListHeader_iconPlus"
268268
onClick={(e) => {
269269
e.preventDefault();
270270
e.stopPropagation();
@@ -289,7 +289,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
289289
<>
290290
<IconizedContextMenuOption
291291
label={_t("action|start_new_chat")}
292-
iconClassName="mx_RoomListHeader_iconStartChat"
292+
iconClassName="mx_LegacyRoomListHeader_iconStartChat"
293293
onClick={(e) => {
294294
e.preventDefault();
295295
e.stopPropagation();
@@ -300,7 +300,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
300300
/>
301301
<IconizedContextMenuOption
302302
label={_t("action|new_room")}
303-
iconClassName="mx_RoomListHeader_iconNewRoom"
303+
iconClassName="mx_LegacyRoomListHeader_iconNewRoom"
304304
onClick={(e) => {
305305
e.preventDefault();
306306
e.stopPropagation();
@@ -312,7 +312,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
312312
{videoRoomsEnabled && (
313313
<IconizedContextMenuOption
314314
label={_t("action|new_video_room")}
315-
iconClassName="mx_RoomListHeader_iconNewVideoRoom"
315+
iconClassName="mx_LegacyRoomListHeader_iconNewVideoRoom"
316316
onClick={(e) => {
317317
e.preventDefault();
318318
e.stopPropagation();
@@ -333,7 +333,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
333333
joinRoomOpt = (
334334
<IconizedContextMenuOption
335335
label={_t("room_list|join_public_room_label")}
336-
iconClassName="mx_RoomListHeader_iconExplore"
336+
iconClassName="mx_LegacyRoomListHeader_iconExplore"
337337
onClick={(e) => {
338338
e.preventDefault();
339339
e.stopPropagation();
@@ -378,13 +378,13 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
378378
})
379379
.join("\n");
380380

381-
let contextMenuButton: JSX.Element = <div className="mx_RoomListHeader_contextLessTitle">{title}</div>;
381+
let contextMenuButton: JSX.Element = <div className="mx_LegacyRoomListHeader_contextLessTitle">{title}</div>;
382382
if (canShowMainMenu) {
383383
const commonProps = {
384384
ref: mainMenuHandle,
385385
onClick: openMainMenu,
386386
isExpanded: mainMenuDisplayed,
387-
className: "mx_RoomListHeader_contextMenuButton",
387+
className: "mx_LegacyRoomListHeader_contextMenuButton",
388388
children: title,
389389
};
390390

@@ -401,7 +401,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
401401
}
402402

403403
return (
404-
<aside className="mx_RoomListHeader" aria-label={_t("room|context_menu|title")}>
404+
<aside className="mx_LegacyRoomListHeader" aria-label={_t("room|context_menu|title")}>
405405
{contextMenuButton}
406406
{pendingActionSummary ? (
407407
<Tooltip label={pendingActionSummary} isTriggerInteractive={false}>
@@ -413,7 +413,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
413413
ref={plusMenuHandle}
414414
onClick={openPlusMenu}
415415
isExpanded={plusMenuDisplayed}
416-
className="mx_RoomListHeader_plusButton"
416+
className="mx_LegacyRoomListHeader_plusButton"
417417
title={_t("action|add")}
418418
/>
419419
)}
@@ -423,4 +423,4 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
423423
);
424424
};
425425

426-
export default RoomListHeader;
426+
export default LegacyRoomListHeader;

test/unit-tests/components/views/rooms/RoomListHeader-test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { act, render, screen, fireEvent, type RenderResult } from "jest-matrix-r
1313

1414
import SpaceStore from "../../../../../src/stores/spaces/SpaceStore";
1515
import { MetaSpace } from "../../../../../src/stores/spaces";
16-
import _RoomListHeader from "../../../../../src/components/views/rooms/RoomListHeader";
16+
import _RoomListHeader from "../../../../../src/components/views/rooms/LegacyRoomListHeader";
1717
import * as testUtils from "../../../../test-utils";
1818
import { stubClient, mkSpace } from "../../../../test-utils";
1919
import DMRoomMap from "../../../../../src/utils/DMRoomMap";

0 commit comments

Comments
 (0)