2021-11-04 21:10:43 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
/* eslint-disable react/no-multi-comp */
|
2021-04-08 08:35:26 +00:00
|
|
|
|
2021-09-20 18:12:56 +00:00
|
|
|
import React, { Component } from 'react';
|
2021-04-08 08:35:26 +00:00
|
|
|
|
|
|
|
import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
|
|
|
|
import { connect } from '../../../base/redux';
|
|
|
|
import { E2EELabel } from '../../../e2ee';
|
2021-09-20 18:12:56 +00:00
|
|
|
import { RecordingLabel } from '../../../recording';
|
2022-03-14 08:31:08 +00:00
|
|
|
import HighlightButton from '../../../recording/components/Recording/web/HighlightButton';
|
2021-04-08 08:35:26 +00:00
|
|
|
import { isToolboxVisible } from '../../../toolbox/functions.web';
|
|
|
|
import { TranscribingLabel } from '../../../transcribing';
|
|
|
|
import { VideoQualityLabel } from '../../../video-quality';
|
|
|
|
import ConferenceTimer from '../ConferenceTimer';
|
2021-09-20 18:12:56 +00:00
|
|
|
import { getConferenceInfo } from '../functions';
|
2021-04-08 08:35:26 +00:00
|
|
|
|
2021-09-20 18:12:56 +00:00
|
|
|
import ConferenceInfoContainer from './ConferenceInfoContainer';
|
|
|
|
import InsecureRoomNameLabel from './InsecureRoomNameLabel';
|
2021-04-08 08:35:26 +00:00
|
|
|
import ParticipantsCount from './ParticipantsCount';
|
2021-12-21 10:22:30 +00:00
|
|
|
import RaisedHandsCountLabel from './RaisedHandsCountLabel';
|
2021-09-20 18:12:56 +00:00
|
|
|
import SubjectText from './SubjectText';
|
2022-06-29 13:59:49 +00:00
|
|
|
import ToggleTopPanelLabel from './ToggleTopPanelLabel';
|
2021-04-08 08:35:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link Subject}.
|
|
|
|
*/
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* The conference info labels to be shown in the conference header.
|
2021-04-08 08:35:26 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
_conferenceInfo: Object,
|
2021-04-08 08:35:26 +00:00
|
|
|
|
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* Indicates whether the component should be visible or not.
|
2021-04-08 08:35:26 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
_visible: boolean
|
|
|
|
};
|
2021-04-08 08:35:26 +00:00
|
|
|
|
2021-09-20 18:12:56 +00:00
|
|
|
const COMPONENTS = [
|
2022-03-14 08:31:08 +00:00
|
|
|
{
|
|
|
|
Component: HighlightButton,
|
|
|
|
id: 'highlight-moment'
|
|
|
|
},
|
2021-09-20 18:12:56 +00:00
|
|
|
{
|
|
|
|
Component: SubjectText,
|
|
|
|
id: 'subject'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Component: ConferenceTimer,
|
|
|
|
id: 'conference-timer'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Component: ParticipantsCount,
|
|
|
|
id: 'participants-count'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Component: E2EELabel,
|
|
|
|
id: 'e2ee'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Component: () => (
|
|
|
|
<>
|
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.FILE } />
|
|
|
|
<RecordingLabel mode = { JitsiRecordingConstants.mode.STREAM } />
|
|
|
|
</>
|
|
|
|
),
|
|
|
|
id: 'recording'
|
|
|
|
},
|
2021-12-21 10:22:30 +00:00
|
|
|
{
|
|
|
|
Component: RaisedHandsCountLabel,
|
|
|
|
id: 'raised-hands-count'
|
|
|
|
},
|
2021-09-20 18:12:56 +00:00
|
|
|
{
|
|
|
|
Component: TranscribingLabel,
|
|
|
|
id: 'transcribing'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Component: VideoQualityLabel,
|
|
|
|
id: 'video-quality'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Component: InsecureRoomNameLabel,
|
|
|
|
id: 'insecure-room'
|
2022-06-29 13:59:49 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
Component: ToggleTopPanelLabel,
|
|
|
|
id: 'top-panel-toggle'
|
2021-09-20 18:12:56 +00:00
|
|
|
}
|
|
|
|
];
|
2021-04-08 08:35:26 +00:00
|
|
|
|
2021-09-20 18:12:56 +00:00
|
|
|
/**
|
|
|
|
* The upper band of the meeing containing the conference name, timer and labels.
|
|
|
|
*
|
|
|
|
* @param {Object} props - The props of the component.
|
|
|
|
* @returns {React$None}
|
|
|
|
*/
|
|
|
|
class ConferenceInfo extends Component<Props> {
|
2021-07-21 08:46:49 +00:00
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* Initializes a new {@code ConferenceInfo} instance.
|
|
|
|
*
|
|
|
|
* @param {Props} props - The read-only React {@code Component} props with
|
|
|
|
* which the new instance is to be initialized.
|
2021-07-21 08:46:49 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
2021-07-21 08:46:49 +00:00
|
|
|
|
2021-09-20 18:12:56 +00:00
|
|
|
this._renderAutoHide = this._renderAutoHide.bind(this);
|
|
|
|
this._renderAlwaysVisible = this._renderAlwaysVisible.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
_renderAutoHide: () => void;
|
2021-04-08 08:35:26 +00:00
|
|
|
|
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* Renders auto-hidden info header labels.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
2021-04-08 08:35:26 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
_renderAutoHide() {
|
|
|
|
const { autoHide } = this.props._conferenceInfo;
|
|
|
|
|
|
|
|
if (!autoHide || !autoHide.length) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2021-12-21 10:22:30 +00:00
|
|
|
<ConferenceInfoContainer
|
|
|
|
id = 'autoHide'
|
|
|
|
visible = { this.props._visible }>
|
2021-09-20 18:12:56 +00:00
|
|
|
{
|
|
|
|
COMPONENTS
|
|
|
|
.filter(comp => autoHide.includes(comp.id))
|
|
|
|
.map(c =>
|
|
|
|
<c.Component key = { c.id } />
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</ConferenceInfoContainer>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_renderAlwaysVisible: () => void;
|
2021-04-08 08:35:26 +00:00
|
|
|
|
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* Renders the always visible info header labels.
|
|
|
|
*
|
|
|
|
* @returns {void}
|
2021-04-08 08:35:26 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
_renderAlwaysVisible() {
|
|
|
|
const { alwaysVisible } = this.props._conferenceInfo;
|
|
|
|
|
|
|
|
if (!alwaysVisible || !alwaysVisible.length) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
2021-12-21 10:22:30 +00:00
|
|
|
<ConferenceInfoContainer
|
|
|
|
id = 'alwaysVisible'
|
|
|
|
visible = { true } >
|
2021-09-20 18:12:56 +00:00
|
|
|
{
|
|
|
|
COMPONENTS
|
|
|
|
.filter(comp => alwaysVisible.includes(comp.id))
|
|
|
|
.map(c =>
|
|
|
|
<c.Component key = { c.id } />
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</ConferenceInfoContainer>
|
|
|
|
);
|
|
|
|
}
|
2021-07-21 08:46:49 +00:00
|
|
|
|
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
2021-07-21 08:46:49 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<div className = 'details-container' >
|
2021-09-30 06:39:14 +00:00
|
|
|
{ this._renderAlwaysVisible() }
|
|
|
|
{ this._renderAutoHide() }
|
2021-04-08 08:35:26 +00:00
|
|
|
</div>
|
2021-09-20 18:12:56 +00:00
|
|
|
);
|
|
|
|
}
|
2021-04-08 08:35:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the Redux state to the associated
|
|
|
|
* {@code Subject}'s props.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
|
|
|
* @private
|
|
|
|
* @returns {{
|
2021-09-20 18:12:56 +00:00
|
|
|
* _visible: boolean,
|
|
|
|
* _conferenceInfo: Object
|
2021-04-08 08:35:26 +00:00
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
|
|
|
return {
|
2021-07-21 08:46:49 +00:00
|
|
|
_visible: isToolboxVisible(state),
|
2021-09-20 18:12:56 +00:00
|
|
|
_conferenceInfo: getConferenceInfo(state)
|
2021-04-08 08:35:26 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(_mapStateToProps)(ConferenceInfo);
|