You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

E2EELabel.js 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { translate } from '../../base/i18n';
  4. import { IconE2EE } from '../../base/icons';
  5. import { Label } from '../../base/label';
  6. import { connect } from '../../base/redux';
  7. import { Tooltip } from '../../base/tooltip';
  8. import { _mapStateToProps, type Props } from './AbstractE2EELabel';
  9. /**
  10. * React {@code Component} for displaying a label when everyone has E2EE enabled in a conferene.
  11. *
  12. * @extends Component
  13. */
  14. class E2EELabel extends Component<Props> {
  15. /**
  16. * Implements React's {@link Component#render()}.
  17. *
  18. * @inheritdoc
  19. * @returns {ReactElement}
  20. */
  21. render() {
  22. if (!this.props._showLabel) {
  23. return null;
  24. }
  25. const { _e2eeLabels, t } = this.props;
  26. const content = _e2eeLabels?.labelToolTip || t('e2ee.labelToolTip');
  27. return (
  28. <Tooltip
  29. content = { content }
  30. position = { 'bottom' }>
  31. <Label
  32. className = 'label--green'
  33. icon = { IconE2EE } />
  34. </Tooltip>
  35. );
  36. }
  37. }
  38. export default translate(connect(_mapStateToProps)(E2EELabel));