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';
|
2021-09-29 12:06:03 +00:00
|
|
|
import { COLORS } from '../../base/label/constants';
|
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
|
|
|
|
2022-09-27 07:10:28 +00:00
|
|
|
import { type Props, _mapStateToProps } from './AbstractE2EELabel';
|
2020-04-23 13:45:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
2022-07-14 07:10:08 +00:00
|
|
|
* React {@code Component} for displaying a label when everyone has E2EE enabled in a conference.
|
2020-04-23 13:45:36 +00:00
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments Component
|
2020-04-23 13:45:36 +00:00
|
|
|
*/
|
|
|
|
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
|
2021-09-29 12:06:03 +00:00
|
|
|
color = { COLORS.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));
|