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

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