* refactor: move Flex component in shared components * refactor: update imports * refactor: remove Flex pcss file * fix: Flex component css override * test: update snapshots * fix: html export * chore: add css module support to jest * chore: keep old copyright * refactor: change `mx_Flex` in `ErrorView` to `mx_ErrorView_flexContainer` * test: update snapshots * refactor: move Box component in shared components * refactor: update import and css override * test: update snapshots
46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
/*
|
|
Copyright 2025 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE files in the repository root for full details.
|
|
*/
|
|
|
|
import React from "react";
|
|
|
|
import { shouldShowComponent } from "../../../../customisations/helpers/UIComponents";
|
|
import { UIComponent } from "../../../../settings/UIFeature";
|
|
import { RoomListSearch } from "./RoomListSearch";
|
|
import { RoomListHeaderView } from "./RoomListHeaderView";
|
|
import { RoomListView } from "./RoomListView";
|
|
import { Flex } from "../../../../shared-components/utils/Flex";
|
|
import { _t } from "../../../../languageHandler";
|
|
|
|
type RoomListPanelProps = {
|
|
/**
|
|
* Current active space
|
|
* See {@link RoomListSearch}
|
|
*/
|
|
activeSpace: string;
|
|
};
|
|
|
|
/**
|
|
* The panel of the room list
|
|
*/
|
|
export const RoomListPanel: React.FC<RoomListPanelProps> = ({ activeSpace }) => {
|
|
const displayRoomSearch = shouldShowComponent(UIComponent.FilterContainer);
|
|
|
|
return (
|
|
<Flex
|
|
as="nav"
|
|
className="mx_RoomListPanel"
|
|
direction="column"
|
|
align="stretch"
|
|
aria-label={_t("room_list|list_title")}
|
|
>
|
|
{displayRoomSearch && <RoomListSearch activeSpace={activeSpace} />}
|
|
<RoomListHeaderView />
|
|
<RoomListView />
|
|
</Flex>
|
|
);
|
|
};
|