jiti-meet/react/features/conference/components/AbstractLabels.js

104 lines
2.5 KiB
JavaScript
Raw Normal View History

2018-06-14 11:14:17 +00:00
// @flow
import React, { Component } from 'react';
import { isFilmstripVisible } from '../../filmstrip';
2018-07-31 22:20:31 +00:00
import { LocalRecordingLabel } from '../../local-recording';
2018-06-14 11:14:17 +00:00
import { RecordingLabel } from '../../recording';
import { TranscribingLabel } from '../../transcribing';
import { shouldDisplayTileView } from '../../video-layout';
2018-06-14 11:14:17 +00:00
import { VideoQualityLabel } from '../../video-quality';
/**
* The type of the React {@code Component} props of {@link AbstractLabels}.
*/
export type Props = {
/**
* Whether the filmstrip is displayed with remote videos. Used to determine
* display classes to set.
*/
2018-06-14 11:14:17 +00:00
_filmstripVisible: boolean,
/**
* Whether the video quality label should be displayed.
*/
_showVideoQualityLabel: boolean
2018-06-14 11:14:17 +00:00
};
/**
* A container to hold video status labels, including recording status and
* current large video quality.
*
* @extends Component
*/
export default class AbstractLabels<P: Props, S> extends Component<P, S> {
/**
* Renders the {@code LocalRecordingLabel}.
2018-06-14 11:14:17 +00:00
*
* @protected
* @returns {React$Element}
*/
_renderLocalRecordingLabel() {
2018-06-14 11:14:17 +00:00
return (
<LocalRecordingLabel />
2018-06-14 11:14:17 +00:00
);
}
/**
* Renders the {@code RecordingLabel} that is platform independent.
2018-06-14 11:14:17 +00:00
*
* @param {string} mode - The recording mode that this label is rendered
* for.
2018-06-14 11:14:17 +00:00
* @protected
* @returns {React$Element}
*/
_renderRecordingLabel(mode: string) {
2018-06-14 11:14:17 +00:00
return (
<RecordingLabel mode = { mode } />
2018-06-14 11:14:17 +00:00
);
}
/**
* Renders the {@code TranscribingLabel}.
*
* @protected
* @returns {React$Element}
*/
_renderTranscribingLabel() {
return (
<TranscribingLabel />
);
}
2018-07-31 22:20:31 +00:00
/**
* Renders the {@code VideoQualityLabel} that is platform independent.
2018-07-31 22:20:31 +00:00
*
* @protected
* @returns {React$Element}
2018-07-31 22:20:31 +00:00
*/
_renderVideoQualityLabel() {
2018-07-31 22:20:31 +00:00
return (
<VideoQualityLabel />
2018-07-31 22:20:31 +00:00
);
}
2018-06-14 11:14:17 +00:00
}
/**
* Maps (parts of) the redux state to the associated props of the {@link Labels}
* {@code Component}.
2018-06-14 11:14:17 +00:00
*
* @param {Object} state - The redux state.
2018-06-14 11:14:17 +00:00
* @private
* @returns {{
* _filmstripVisible: boolean,
* _showVideoQualityLabel: boolean
2018-06-14 11:14:17 +00:00
* }}
*/
export function _abstractMapStateToProps(state: Object) {
return {
_filmstripVisible: isFilmstripVisible(state),
_showVideoQualityLabel: !shouldDisplayTileView(state)
2018-06-14 11:14:17 +00:00
};
}