Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

LocalRecordingLabel.web.js 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { translate } from '../../base/i18n/index';
  4. import { Label } from '../../base/label/index';
  5. import { connect } from '../../base/redux';
  6. import { Tooltip } from '../../base/tooltip';
  7. /**
  8. * The type of the React {@code Component} props of {@link LocalRecordingLabel}.
  9. */
  10. type Props = {
  11. /**
  12. * Whether this is the Jibri recorder participant.
  13. */
  14. _iAmRecorder: boolean,
  15. /**
  16. * Whether local recording is engaged or not.
  17. */
  18. _isEngaged: boolean,
  19. /**
  20. * Invoked to obtain translated strings.
  21. */
  22. t: Function,
  23. };
  24. /**
  25. * React Component for displaying a label when local recording is engaged.
  26. *
  27. * @extends Component
  28. */
  29. class LocalRecordingLabel extends Component<Props> {
  30. /**
  31. * Implements React's {@link Component#render()}.
  32. *
  33. * @inheritdoc
  34. * @returns {ReactElement}
  35. */
  36. render() {
  37. if (!this.props._isEngaged || this.props._iAmRecorder) {
  38. return null;
  39. }
  40. return (
  41. <Tooltip
  42. content = { this.props.t('localRecording.labelToolTip') }
  43. position = { 'bottom' }>
  44. <Label
  45. className = 'local-rec'
  46. text = { this.props.t('localRecording.label') } />
  47. </Tooltip>
  48. );
  49. }
  50. }
  51. /**
  52. * Maps (parts of) the Redux state to the associated props for the
  53. * {@code LocalRecordingLabel} component.
  54. *
  55. * @param {Object} state - The Redux state.
  56. * @private
  57. * @returns {{
  58. * }}
  59. */
  60. function _mapStateToProps(state) {
  61. const { isEngaged } = state['features/local-recording'];
  62. const { iAmRecorder } = state['features/base/config'];
  63. return {
  64. _isEngaged: isEngaged,
  65. _iAmRecorder: iAmRecorder
  66. };
  67. }
  68. export default translate(connect(_mapStateToProps)(LocalRecordingLabel));