2019-02-07 22:52:31 +00:00
|
|
|
// @flow
|
|
|
|
|
2019-03-20 20:09:23 +00:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import { NotificationsContainer } from '../../notifications/components';
|
2019-02-07 22:52:31 +00:00
|
|
|
import { shouldDisplayTileView } from '../../video-layout';
|
2020-05-20 10:57:03 +00:00
|
|
|
import { shouldDisplayNotifications } from '../functions';
|
2019-02-07 22:52:31 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link AbstractLabels}.
|
|
|
|
*/
|
|
|
|
export type AbstractProps = {
|
|
|
|
|
2019-03-20 20:09:23 +00:00
|
|
|
/**
|
|
|
|
* Set to {@code true} when the notifications are to be displayed.
|
|
|
|
*
|
|
|
|
* @protected
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
_notificationsVisible: boolean,
|
|
|
|
|
2019-02-07 22:52:31 +00:00
|
|
|
/**
|
|
|
|
* Conference room name.
|
|
|
|
*
|
|
|
|
* @protected
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
_room: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether or not the layout should change to support tile view mode.
|
|
|
|
*
|
|
|
|
* @protected
|
|
|
|
* @type {boolean}
|
|
|
|
*/
|
|
|
|
_shouldDisplayTileView: boolean
|
|
|
|
};
|
|
|
|
|
2019-03-20 20:09:23 +00:00
|
|
|
/**
|
|
|
|
* A container to hold video status labels, including recording status and
|
|
|
|
* current large video quality.
|
|
|
|
*
|
|
|
|
* @extends Component
|
|
|
|
*/
|
|
|
|
export class AbstractConference<P: AbstractProps, S>
|
|
|
|
extends Component<P, S> {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Renders the {@code LocalRecordingLabel}.
|
|
|
|
*
|
|
|
|
* @param {Object} props - The properties to be passed to
|
|
|
|
* the {@code NotificationsContainer}.
|
|
|
|
* @protected
|
|
|
|
* @returns {React$Element}
|
|
|
|
*/
|
|
|
|
renderNotificationsContainer(props: ?Object) {
|
|
|
|
if (this.props._notificationsVisible) {
|
|
|
|
return (
|
|
|
|
React.createElement(NotificationsContainer, props)
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-02-07 22:52:31 +00:00
|
|
|
/**
|
|
|
|
* Maps (parts of) the redux state to the associated props of the {@link Labels}
|
|
|
|
* {@code Component}.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The redux state.
|
|
|
|
* @private
|
|
|
|
* @returns {AbstractProps}
|
|
|
|
*/
|
|
|
|
export function abstractMapStateToProps(state: Object) {
|
|
|
|
return {
|
2019-03-20 20:09:23 +00:00
|
|
|
_notificationsVisible: shouldDisplayNotifications(state),
|
2019-02-07 22:52:31 +00:00
|
|
|
_room: state['features/base/conference'].room,
|
|
|
|
_shouldDisplayTileView: shouldDisplayTileView(state)
|
|
|
|
};
|
|
|
|
}
|