2018-04-12 01:58:04 +03:00
|
|
|
/*
|
2019-07-31 14:19:29 +03:00
|
|
|
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
|
2021-05-25 14:13:16 +03:00
|
|
|
Copyright 2015 - 2021 The Matrix.org Foundation C.I.C.
|
2018-04-12 01:58:04 +03:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
2021-06-03 10:41:22 +03:00
|
|
|
import { Room } from "matrix-js-sdk/src/models/room";
|
|
|
|
import { User } from "matrix-js-sdk/src/models/user";
|
|
|
|
import { RoomMember } from "matrix-js-sdk/src/models/room-member";
|
|
|
|
import { MatrixEvent } from "matrix-js-sdk/src/models/event";
|
|
|
|
import { VerificationRequest } from "matrix-js-sdk/src/crypto/verification/request/VerificationRequest";
|
2020-09-03 18:08:10 +03:00
|
|
|
|
2020-05-14 05:41:41 +03:00
|
|
|
import dis from '../../dispatcher/dispatcher';
|
2018-04-13 02:43:44 +03:00
|
|
|
import RateLimitedFunc from '../../ratelimitedfunc';
|
2018-05-01 13:18:45 +03:00
|
|
|
import GroupStore from '../../stores/GroupStore';
|
2021-03-01 21:10:17 +03:00
|
|
|
import {
|
|
|
|
RIGHT_PANEL_PHASES_NO_ARGS,
|
|
|
|
RIGHT_PANEL_SPACE_PHASES,
|
2021-05-25 18:10:44 +03:00
|
|
|
RightPanelPhases,
|
2021-03-01 21:10:17 +03:00
|
|
|
} from "../../stores/RightPanelStorePhases";
|
2019-12-06 09:48:05 +03:00
|
|
|
import RightPanelStore from "../../stores/RightPanelStore";
|
2019-12-17 20:26:12 +03:00
|
|
|
import MatrixClientContext from "../../contexts/MatrixClientContext";
|
2021-06-03 10:41:22 +03:00
|
|
|
import { Action } from "../../dispatcher/actions";
|
2020-09-08 10:48:03 +03:00
|
|
|
import RoomSummaryCard from "../views/right_panel/RoomSummaryCard";
|
|
|
|
import WidgetCard from "../views/right_panel/WidgetCard";
|
2021-06-03 10:41:22 +03:00
|
|
|
import { replaceableComponent } from "../../utils/replaceableComponent";
|
2021-05-06 01:59:07 +03:00
|
|
|
import SettingsStore from "../../settings/SettingsStore";
|
2021-06-03 10:41:22 +03:00
|
|
|
import { ActionPayload } from "../../dispatcher/payloads";
|
2021-05-25 14:13:16 +03:00
|
|
|
import MemberList from "../views/rooms/MemberList";
|
|
|
|
import GroupMemberList from "../views/groups/GroupMemberList";
|
|
|
|
import GroupRoomList from "../views/groups/GroupRoomList";
|
|
|
|
import GroupRoomInfo from "../views/groups/GroupRoomInfo";
|
|
|
|
import UserInfo from "../views/right_panel/UserInfo";
|
|
|
|
import ThirdPartyMemberInfo from "../views/rooms/ThirdPartyMemberInfo";
|
|
|
|
import FilePanel from "./FilePanel";
|
|
|
|
import NotificationPanel from "./NotificationPanel";
|
|
|
|
import ResizeNotifier from "../../utils/ResizeNotifier";
|
2021-05-25 18:10:44 +03:00
|
|
|
import PinnedMessagesCard from "../views/right_panel/PinnedMessagesCard";
|
2021-05-25 14:13:16 +03:00
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
room?: Room; // if showing panels for a given room, this is set
|
|
|
|
groupId?: string; // if showing panels for a given group, this is set
|
|
|
|
user?: User; // used if we know the user ahead of opening the panel
|
|
|
|
resizeNotifier: ResizeNotifier;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IState {
|
|
|
|
phase: RightPanelPhases;
|
|
|
|
isUserPrivilegedInGroup?: boolean;
|
|
|
|
member?: RoomMember;
|
|
|
|
verificationRequest?: VerificationRequest;
|
|
|
|
verificationRequestPromise?: Promise<VerificationRequest>;
|
|
|
|
space?: Room;
|
|
|
|
widgetId?: string;
|
|
|
|
groupRoomId?: string;
|
|
|
|
groupId?: string;
|
|
|
|
event: MatrixEvent;
|
|
|
|
}
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-03-09 05:35:10 +03:00
|
|
|
@replaceableComponent("structures.RightPanel")
|
2021-05-25 14:13:16 +03:00
|
|
|
export default class RightPanel extends React.Component<IProps, IState> {
|
2019-12-17 20:26:12 +03:00
|
|
|
static contextType = MatrixClientContext;
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
private readonly delayedUpdate: RateLimitedFunc;
|
|
|
|
private dispatcherRef: string;
|
|
|
|
|
2020-08-29 14:51:37 +03:00
|
|
|
constructor(props, context) {
|
|
|
|
super(props, context);
|
2018-10-30 19:15:19 +03:00
|
|
|
this.state = {
|
2020-08-28 12:52:04 +03:00
|
|
|
...RightPanelStore.getSharedInstance().roomPanelPhaseParams,
|
2021-05-25 14:13:16 +03:00
|
|
|
phase: this.getPhaseFromProps(),
|
2018-10-30 19:15:19 +03:00
|
|
|
isUserPrivilegedInGroup: null,
|
2021-05-25 14:13:16 +03:00
|
|
|
member: this.getUserForPanel(),
|
2018-10-30 19:15:19 +03:00
|
|
|
};
|
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
this.delayedUpdate = new RateLimitedFunc(() => {
|
2018-10-30 19:15:19 +03:00
|
|
|
this.forceUpdate();
|
|
|
|
}, 500);
|
|
|
|
}
|
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
// Helper function to split out the logic for getPhaseFromProps() and the constructor
|
2019-12-07 01:04:44 +03:00
|
|
|
// as both are called at the same time in the constructor.
|
2021-05-25 14:13:16 +03:00
|
|
|
private getUserForPanel() {
|
2019-12-07 01:04:44 +03:00
|
|
|
if (this.state && this.state.member) return this.state.member;
|
|
|
|
const lastParams = RightPanelStore.getSharedInstance().roomPanelPhaseParams;
|
|
|
|
return this.props.user || lastParams['member'];
|
|
|
|
}
|
|
|
|
|
2020-01-29 19:56:12 +03:00
|
|
|
// gets the current phase from the props and also maybe the store
|
2021-05-25 14:13:16 +03:00
|
|
|
private getPhaseFromProps() {
|
2019-12-06 09:48:05 +03:00
|
|
|
const rps = RightPanelStore.getSharedInstance();
|
2021-05-25 14:13:16 +03:00
|
|
|
const userForPanel = this.getUserForPanel();
|
2019-02-20 14:45:55 +03:00
|
|
|
if (this.props.groupId) {
|
2019-12-06 09:48:05 +03:00
|
|
|
if (!RIGHT_PANEL_PHASES_NO_ARGS.includes(rps.groupPanelPhase)) {
|
2021-06-29 15:11:58 +03:00
|
|
|
dis.dispatch({ action: Action.SetRightPanelPhase, phase: RightPanelPhases.GroupMemberList });
|
2020-07-18 14:08:20 +03:00
|
|
|
return RightPanelPhases.GroupMemberList;
|
2019-12-06 09:48:05 +03:00
|
|
|
}
|
|
|
|
return rps.groupPanelPhase;
|
2021-05-06 01:59:07 +03:00
|
|
|
} else if (SettingsStore.getValue("feature_spaces") && this.props.room?.isSpaceRoom()
|
|
|
|
&& !RIGHT_PANEL_SPACE_PHASES.includes(rps.roomPanelPhase)
|
|
|
|
) {
|
2021-03-01 21:10:17 +03:00
|
|
|
return RightPanelPhases.SpaceMemberList;
|
2020-01-29 19:56:12 +03:00
|
|
|
} else if (userForPanel) {
|
|
|
|
// XXX FIXME AAAAAARGH: What is going on with this class!? It takes some of its state
|
2020-01-29 20:51:51 +03:00
|
|
|
// from its props and some from a store, except if the contents of the store changes
|
2020-01-29 19:56:12 +03:00
|
|
|
// while it's mounted in which case it replaces all of its state with that of the store,
|
2020-01-29 20:52:12 +03:00
|
|
|
// except it uses a dispatch instead of a normal store listener?
|
2020-01-29 19:56:12 +03:00
|
|
|
// Unfortunately rewriting this would almost certainly break showing the right panel
|
|
|
|
// in some of the many cases, and I don't have time to re-architect it and test all
|
|
|
|
// the flows now, so adding yet another special case so if the store thinks there is
|
|
|
|
// a verification going on for the member we're displaying, we show that, otherwise
|
|
|
|
// we race if a verification is started while the panel isn't displayed because we're
|
|
|
|
// not mounted in time to get the dispatch.
|
|
|
|
// Until then, let this code serve as a warning from history.
|
|
|
|
if (
|
2020-02-19 12:40:00 +03:00
|
|
|
rps.roomPanelPhaseParams.member &&
|
2020-01-29 19:56:12 +03:00
|
|
|
userForPanel.userId === rps.roomPanelPhaseParams.member.userId &&
|
|
|
|
rps.roomPanelPhaseParams.verificationRequest
|
|
|
|
) {
|
|
|
|
return rps.roomPanelPhase;
|
|
|
|
}
|
2020-07-18 14:08:20 +03:00
|
|
|
return RightPanelPhases.RoomMemberInfo;
|
2019-02-20 14:45:55 +03:00
|
|
|
}
|
2021-03-01 21:10:17 +03:00
|
|
|
return rps.roomPanelPhase;
|
2019-02-20 14:45:55 +03:00
|
|
|
}
|
|
|
|
|
2020-03-31 23:14:17 +03:00
|
|
|
componentDidMount() {
|
2018-04-12 01:58:04 +03:00
|
|
|
this.dispatcherRef = dis.register(this.onAction);
|
2019-12-17 20:26:12 +03:00
|
|
|
const cli = this.context;
|
2018-04-12 01:58:04 +03:00
|
|
|
cli.on("RoomState.members", this.onRoomStateMember);
|
2021-05-25 14:13:16 +03:00
|
|
|
this.initGroupStore(this.props.groupId);
|
2018-10-30 19:15:19 +03:00
|
|
|
}
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2018-10-30 19:15:19 +03:00
|
|
|
componentWillUnmount() {
|
2018-04-12 01:58:04 +03:00
|
|
|
dis.unregister(this.dispatcherRef);
|
2019-12-17 20:26:12 +03:00
|
|
|
if (this.context) {
|
|
|
|
this.context.removeListener("RoomState.members", this.onRoomStateMember);
|
2018-04-12 01:58:04 +03:00
|
|
|
}
|
2021-05-25 14:13:16 +03:00
|
|
|
this.unregisterGroupStore();
|
2018-10-30 19:15:19 +03:00
|
|
|
}
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2020-04-01 23:35:39 +03:00
|
|
|
// TODO: [REACT-WARNING] Replace with appropriate lifecycle event
|
2020-04-01 23:45:54 +03:00
|
|
|
UNSAFE_componentWillReceiveProps(newProps) { // eslint-disable-line camelcase
|
2018-04-12 01:58:04 +03:00
|
|
|
if (newProps.groupId !== this.props.groupId) {
|
2021-05-25 14:13:16 +03:00
|
|
|
this.unregisterGroupStore();
|
|
|
|
this.initGroupStore(newProps.groupId);
|
2018-04-12 01:58:04 +03:00
|
|
|
}
|
2018-10-30 19:15:19 +03:00
|
|
|
}
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
private initGroupStore(groupId: string) {
|
2018-04-12 01:58:04 +03:00
|
|
|
if (!groupId) return;
|
2018-05-01 13:18:45 +03:00
|
|
|
GroupStore.registerListener(groupId, this.onGroupStoreUpdated);
|
2018-10-30 19:15:19 +03:00
|
|
|
}
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
private unregisterGroupStore() {
|
2018-05-01 13:18:45 +03:00
|
|
|
GroupStore.unregisterListener(this.onGroupStoreUpdated);
|
2018-10-30 19:15:19 +03:00
|
|
|
}
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
private onGroupStoreUpdated = () => {
|
2018-04-12 01:58:04 +03:00
|
|
|
this.setState({
|
2018-05-01 13:18:45 +03:00
|
|
|
isUserPrivilegedInGroup: GroupStore.isUserPrivileged(this.props.groupId),
|
2018-04-12 01:58:04 +03:00
|
|
|
});
|
2021-05-25 14:13:16 +03:00
|
|
|
};
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
private onRoomStateMember = (ev: MatrixEvent, _, member: RoomMember) => {
|
2020-10-06 20:11:28 +03:00
|
|
|
if (!this.props.room || member.roomId !== this.props.room.roomId) {
|
2018-09-07 15:16:26 +03:00
|
|
|
return;
|
|
|
|
}
|
2018-04-12 01:58:04 +03:00
|
|
|
// redraw the badge on the membership list
|
2020-08-28 12:45:20 +03:00
|
|
|
if (this.state.phase === RightPanelPhases.RoomMemberList && member.roomId === this.props.room.roomId) {
|
2021-05-25 14:13:16 +03:00
|
|
|
this.delayedUpdate();
|
2020-08-28 12:45:20 +03:00
|
|
|
} else if (this.state.phase === RightPanelPhases.RoomMemberInfo && member.roomId === this.props.room.roomId &&
|
2018-04-12 01:58:04 +03:00
|
|
|
member.userId === this.state.member.userId) {
|
|
|
|
// refresh the member info (e.g. new power level)
|
2021-05-25 14:13:16 +03:00
|
|
|
this.delayedUpdate();
|
2018-04-12 01:58:04 +03:00
|
|
|
}
|
2021-05-25 14:13:16 +03:00
|
|
|
};
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
private onAction = (payload: ActionPayload) => {
|
2020-07-18 14:08:20 +03:00
|
|
|
if (payload.action === Action.AfterRightPanelPhaseChange) {
|
2018-04-12 01:58:04 +03:00
|
|
|
this.setState({
|
|
|
|
phase: payload.phase,
|
2018-12-10 18:52:45 +03:00
|
|
|
groupRoomId: payload.groupRoomId,
|
|
|
|
groupId: payload.groupId,
|
2018-10-30 19:15:19 +03:00
|
|
|
member: payload.member,
|
2019-03-29 05:38:15 +03:00
|
|
|
event: payload.event,
|
2019-12-10 19:53:51 +03:00
|
|
|
verificationRequest: payload.verificationRequest,
|
2020-03-05 19:44:35 +03:00
|
|
|
verificationRequestPromise: payload.verificationRequestPromise,
|
2020-09-08 10:48:03 +03:00
|
|
|
widgetId: payload.widgetId,
|
2021-03-01 21:10:17 +03:00
|
|
|
space: payload.space,
|
2018-04-12 01:58:04 +03:00
|
|
|
});
|
|
|
|
}
|
2021-05-25 14:13:16 +03:00
|
|
|
};
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2021-05-25 14:13:16 +03:00
|
|
|
private onClose = () => {
|
2020-05-27 12:28:25 +03:00
|
|
|
// XXX: There are three different ways of 'closing' this panel depending on what state
|
|
|
|
// things are in... this knows far more than it should do about the state of the rest
|
|
|
|
// of the app and is generally a bit silly.
|
|
|
|
if (this.props.user) {
|
|
|
|
// If we have a user prop then we're displaying a user from the 'user' page type
|
|
|
|
// in LoggedInView, so need to change the page type to close the panel (we switch
|
|
|
|
// to the home page which is not obviously the correct thing to do, but I'm not sure
|
|
|
|
// anything else is - we could hide the close button altogether?)
|
|
|
|
dis.dispatch({
|
|
|
|
action: "view_home_page",
|
|
|
|
});
|
2021-01-30 11:38:10 +03:00
|
|
|
} else if (
|
|
|
|
this.state.phase === RightPanelPhases.EncryptionPanel &&
|
2020-09-29 12:11:04 +03:00
|
|
|
this.state.verificationRequest && this.state.verificationRequest.pending
|
|
|
|
) {
|
|
|
|
// When the user clicks close on the encryption panel cancel the pending request first if any
|
|
|
|
this.state.verificationRequest.cancel();
|
2020-05-27 12:28:25 +03:00
|
|
|
} else {
|
2021-01-30 11:38:10 +03:00
|
|
|
// the RightPanelStore has no way of knowing which mode room/group it is in, so we handle closing here
|
2021-02-04 18:53:25 +03:00
|
|
|
dis.dispatch({
|
2021-01-30 11:38:10 +03:00
|
|
|
action: Action.ToggleRightPanel,
|
|
|
|
type: this.props.groupId ? "group" : "room",
|
2020-05-27 12:28:25 +03:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2018-10-30 19:15:19 +03:00
|
|
|
render() {
|
2018-04-12 01:58:04 +03:00
|
|
|
let panel = <div />;
|
2020-09-08 19:34:32 +03:00
|
|
|
const roomId = this.props.room ? this.props.room.roomId : undefined;
|
2018-04-12 01:58:04 +03:00
|
|
|
|
2020-01-29 02:43:09 +03:00
|
|
|
switch (this.state.phase) {
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.RoomMemberList:
|
2020-09-08 19:34:32 +03:00
|
|
|
if (roomId) {
|
2020-09-08 20:04:24 +03:00
|
|
|
panel = <MemberList roomId={roomId} key={roomId} onClose={this.onClose} />;
|
2020-01-29 02:43:09 +03:00
|
|
|
}
|
|
|
|
break;
|
2021-03-01 21:10:17 +03:00
|
|
|
case RightPanelPhases.SpaceMemberList:
|
|
|
|
panel = <MemberList
|
|
|
|
roomId={this.state.space ? this.state.space.roomId : roomId}
|
|
|
|
key={this.state.space ? this.state.space.roomId : roomId}
|
|
|
|
onClose={this.onClose}
|
|
|
|
/>;
|
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.GroupMemberList:
|
2020-01-29 02:43:09 +03:00
|
|
|
if (this.props.groupId) {
|
|
|
|
panel = <GroupMemberList groupId={this.props.groupId} key={this.props.groupId} />;
|
|
|
|
}
|
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.GroupRoomList:
|
2020-01-29 02:43:09 +03:00
|
|
|
panel = <GroupRoomList groupId={this.props.groupId} key={this.props.groupId} />;
|
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.RoomMemberInfo:
|
2021-03-01 21:10:17 +03:00
|
|
|
case RightPanelPhases.SpaceMemberInfo:
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.EncryptionPanel:
|
2020-05-27 12:28:25 +03:00
|
|
|
panel = <UserInfo
|
|
|
|
user={this.state.member}
|
2021-03-01 21:10:17 +03:00
|
|
|
room={this.state.phase === RightPanelPhases.SpaceMemberInfo ? this.state.space : this.props.room}
|
2020-09-08 19:34:32 +03:00
|
|
|
key={roomId || this.state.member.userId}
|
2021-01-30 10:04:25 +03:00
|
|
|
onClose={this.onClose}
|
2020-05-27 12:28:25 +03:00
|
|
|
phase={this.state.phase}
|
|
|
|
verificationRequest={this.state.verificationRequest}
|
|
|
|
verificationRequestPromise={this.state.verificationRequestPromise}
|
|
|
|
/>;
|
2020-01-29 02:43:09 +03:00
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.Room3pidMemberInfo:
|
2021-03-01 21:10:17 +03:00
|
|
|
case RightPanelPhases.Space3pidMemberInfo:
|
2020-09-08 19:34:32 +03:00
|
|
|
panel = <ThirdPartyMemberInfo event={this.state.event} key={roomId} />;
|
2020-01-29 02:43:09 +03:00
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.GroupMemberInfo:
|
2020-05-27 12:28:25 +03:00
|
|
|
panel = <UserInfo
|
|
|
|
user={this.state.member}
|
|
|
|
groupId={this.props.groupId}
|
|
|
|
key={this.state.member.userId}
|
2021-05-25 14:13:16 +03:00
|
|
|
phase={this.state.phase}
|
2021-01-30 10:04:25 +03:00
|
|
|
onClose={this.onClose} />;
|
2020-01-29 02:43:09 +03:00
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.GroupRoomInfo:
|
2020-01-29 02:43:09 +03:00
|
|
|
panel = <GroupRoomInfo
|
|
|
|
groupRoomId={this.state.groupRoomId}
|
|
|
|
groupId={this.props.groupId}
|
|
|
|
key={this.state.groupRoomId} />;
|
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.NotificationPanel:
|
2021-06-03 10:35:12 +03:00
|
|
|
panel = <NotificationPanel onClose={this.onClose} />;
|
2021-05-25 18:10:44 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RightPanelPhases.PinnedMessages:
|
2021-06-03 10:35:12 +03:00
|
|
|
if (SettingsStore.getValue("feature_pinning")) {
|
|
|
|
panel = <PinnedMessagesCard room={this.props.room} onClose={this.onClose} />;
|
|
|
|
}
|
2020-01-29 02:43:09 +03:00
|
|
|
break;
|
2020-09-08 10:48:03 +03:00
|
|
|
|
2020-07-18 14:08:20 +03:00
|
|
|
case RightPanelPhases.FilePanel:
|
2020-09-08 20:04:24 +03:00
|
|
|
panel = <FilePanel roomId={roomId} resizeNotifier={this.props.resizeNotifier} onClose={this.onClose} />;
|
2020-09-08 10:48:03 +03:00
|
|
|
break;
|
|
|
|
|
|
|
|
case RightPanelPhases.RoomSummary:
|
|
|
|
panel = <RoomSummaryCard room={this.props.room} onClose={this.onClose} />;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case RightPanelPhases.Widget:
|
|
|
|
panel = <WidgetCard room={this.props.room} widgetId={this.state.widgetId} onClose={this.onClose} />;
|
2020-01-29 02:43:09 +03:00
|
|
|
break;
|
2018-04-12 01:58:04 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2020-10-15 18:13:16 +03:00
|
|
|
<aside className="mx_RightPanel dark-panel" id="mx_RightPanel">
|
2018-04-12 01:58:04 +03:00
|
|
|
{ panel }
|
|
|
|
</aside>
|
|
|
|
);
|
2018-10-30 19:15:19 +03:00
|
|
|
}
|
|
|
|
}
|