Files
ThreadNet-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.

68 lines
2.1 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";
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";
import AutoHideScrollbar from "../../structures/AutoHideScrollbar";
2021-06-16 12:07:58 +01:00
import { UIFeature } from "../../../settings/UIFeature";
2025-02-05 13:25:06 +00:00
import type ResizeNotifier from "../../../utils/ResizeNotifier";
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
resizeNotifier: ResizeNotifier;
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
2020-12-03 17:45:49 +00:00
roomId={this.props.room.roomId}
2021-03-02 14:09:11 +01:00
resizeNotifier={this.props.resizeNotifier}
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}
resizeNotifier={this.props.resizeNotifier}
/>
);
}
return (
<AutoHideScrollbar role="region" className="mx_AuxPanel">
2021-08-27 13:31:43 +02:00
{this.props.children}
{appsDrawer}
{callView}
</AutoHideScrollbar>
);
2020-08-29 12:14:16 +01:00
}
}