2018-07-31 22:20:31 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../base/i18n/index';
|
2021-04-08 08:35:26 +00:00
|
|
|
import { Label } from '../../base/label/index';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../base/redux';
|
2021-02-04 13:24:25 +00:00
|
|
|
import { Tooltip } from '../../base/tooltip';
|
2018-07-31 22:20:31 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link LocalRecordingLabel}.
|
|
|
|
*/
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* Whether this is the Jibri recorder participant.
|
2018-07-31 22:20:31 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
_iAmRecorder: boolean,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Whether local recording is engaged or not.
|
|
|
|
*/
|
|
|
|
_isEngaged: boolean,
|
2018-07-31 22:20:31 +00:00
|
|
|
|
|
|
|
/**
|
2021-09-20 18:12:56 +00:00
|
|
|
* Invoked to obtain translated strings.
|
2018-07-31 22:20:31 +00:00
|
|
|
*/
|
2021-09-20 18:12:56 +00:00
|
|
|
t: Function,
|
2018-07-31 22:20:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* React Component for displaying a label when local recording is engaged.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments Component
|
2018-07-31 22:20:31 +00:00
|
|
|
*/
|
|
|
|
class LocalRecordingLabel extends Component<Props> {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
2021-09-20 18:12:56 +00:00
|
|
|
if (!this.props._isEngaged || this.props._iAmRecorder) {
|
2018-07-31 22:20:31 +00:00
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Tooltip
|
|
|
|
content = { this.props.t('localRecording.labelToolTip') }
|
2021-04-08 08:35:26 +00:00
|
|
|
position = { 'bottom' }>
|
|
|
|
<Label
|
2018-07-31 22:20:31 +00:00
|
|
|
className = 'local-rec'
|
2021-04-08 08:35:26 +00:00
|
|
|
text = { this.props.t('localRecording.label') } />
|
2018-07-31 22:20:31 +00:00
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Maps (parts of) the Redux state to the associated props for the
|
|
|
|
* {@code LocalRecordingLabel} component.
|
|
|
|
*
|
|
|
|
* @param {Object} state - The Redux state.
|
|
|
|
* @private
|
|
|
|
* @returns {{
|
|
|
|
* }}
|
|
|
|
*/
|
|
|
|
function _mapStateToProps(state) {
|
|
|
|
const { isEngaged } = state['features/local-recording'];
|
2021-09-20 18:12:56 +00:00
|
|
|
const { iAmRecorder } = state['features/base/config'];
|
2018-07-31 22:20:31 +00:00
|
|
|
|
|
|
|
return {
|
2021-09-20 18:12:56 +00:00
|
|
|
_isEngaged: isEngaged,
|
|
|
|
_iAmRecorder: iAmRecorder
|
2018-07-31 22:20:31 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect(_mapStateToProps)(LocalRecordingLabel));
|