Files
ThreadNet-Web/apps/web/src/components/views/rooms/AuxPanel.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.7 KiB
TypeScript
Raw Normal View History

/*
2024-09-09 14:57:16 +01:00
Copyright 2024 New Vector Ltd.
Copyright 2015-2023 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
2024-09-09 14:57:16 +01:00
Please see LICENSE files in the repository root for full details.
*/
2025-02-05 13:25:06 +00:00
import React, { type ReactNode } from "react";
import { type Room } from "matrix-js-sdk/src/matrix";
import { AutoHideScrollbar } from "@element-hq/web-shared-components";
2021-06-18 16:22:31 +01:00
import AppsDrawer from "./AppsDrawer";
2018-12-24 15:09:10 +00:00
import SettingsStore from "../../../settings/SettingsStore";
2021-06-16 12:07:58 +01:00
import { UIFeature } from "../../../settings/UIFeature";
import LegacyCallViewForRoom from "../voip/LegacyCallViewForRoom";
2021-06-16 12:07:58 +01:00
import { objectHasDiff } from "../../../utils/objects";
2017-05-30 16:09:57 +02:00
2020-10-30 17:29:32 +00:00
interface IProps {
// js-sdk room object
2021-07-01 23:23:03 +01:00
room: Room;
userId: string;
showApps: boolean; // Render apps
children?: ReactNode;
2020-10-30 17:29:32 +00:00
}
export default class AuxPanel extends React.Component<IProps> {
public static defaultProps = {
showApps: true,
2020-08-29 12:14:16 +01:00
};
public shouldComponentUpdate(nextProps: IProps): boolean {
return objectHasDiff(this.props, nextProps);
2020-08-29 12:14:16 +01:00
}
2019-01-08 11:14:31 +00:00
public render(): React.ReactNode {
const callView = <LegacyCallViewForRoom roomId={this.props.room.roomId} showApps={this.props.showApps} />;
let appsDrawer;
if (SettingsStore.getValue(UIFeature.Widgets)) {
appsDrawer = (
<AppsDrawer room={this.props.room} userId={this.props.userId} showApps={this.props.showApps} />
);
}
return (
<AutoHideScrollbar role="region" className="mx_AutoHideScrollbar mx_AuxPanel">
2021-08-27 13:31:43 +02:00
{this.props.children}
{appsDrawer}
{callView}
</AutoHideScrollbar>
);
2020-08-29 12:14:16 +01:00
}
}