2020-04-23 13:45:36 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
|
|
|
import { translate } from '../../base/i18n';
|
2020-05-18 11:54:55 +00:00
|
|
|
import { IconE2EE } from '../../base/icons';
|
2021-04-08 08:35:26 +00:00
|
|
|
import { Label } from '../../base/label';
|
2020-04-23 13:45:36 +00:00
|
|
|
import { connect } from '../../base/redux';
|
2021-02-04 13:24:25 +00:00
|
|
|
import { Tooltip } from '../../base/tooltip';
|
2020-04-23 13:45:36 +00:00
|
|
|
|
|
|
|
import { _mapStateToProps, type Props } from './AbstractE2EELabel';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* React {@code Component} for displaying a label when everyone has E2EE enabled in a conferene.
|
|
|
|
*
|
|
|
|
* @extends Component
|
|
|
|
*/
|
|
|
|
class E2EELabel extends Component<Props> {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
if (!this.props._showLabel) {
|
|
|
|
return null;
|
|
|
|
}
|
2021-09-09 08:10:09 +00:00
|
|
|
const { _e2eeLabels, t } = this.props;
|
|
|
|
const content = _e2eeLabels?.labelToolTip || t('e2ee.labelToolTip');
|
2020-04-23 13:45:36 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Tooltip
|
2021-09-09 08:10:09 +00:00
|
|
|
content = { content }
|
2021-04-08 08:35:26 +00:00
|
|
|
position = { 'bottom' }>
|
|
|
|
<Label
|
|
|
|
className = 'label--green'
|
2020-05-18 11:54:55 +00:00
|
|
|
icon = { IconE2EE } />
|
2020-04-23 13:45:36 +00:00
|
|
|
</Tooltip>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect(_mapStateToProps)(E2EELabel));
|