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.

TranscribingLabel.native.tsx 1.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import React, { Component } from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { connect } from 'react-redux';
  4. import { IReduxState } from '../../app/types';
  5. import { translate } from '../../base/i18n/functions';
  6. import Label from '../../base/label/components/native/Label';
  7. /**
  8. * The type of the React {@code Component} props of {@link TranscribingLabel}.
  9. */
  10. export interface IProps extends WithTranslation {
  11. /**
  12. * True if the label needs to be rendered, false otherwise.
  13. */
  14. _showLabel: boolean;
  15. }
  16. /**
  17. * React {@code Component} for displaying a label when a transcriber is in the
  18. * conference.
  19. *
  20. * @augments Component
  21. */
  22. class TranscribingLabel extends Component<IProps> {
  23. /**
  24. * Renders the platform-specific label component.
  25. *
  26. * @inheritdoc
  27. */
  28. render() {
  29. if (!this.props._showLabel) {
  30. return null;
  31. }
  32. return <Label text = { this.props.t('transcribing.tr') } />;
  33. }
  34. }
  35. /**
  36. * Maps (parts of) the redux state to the associated props of the
  37. * {@link AbstractTranscribingLabel} {@code Component}.
  38. *
  39. * @param {Object} state - The redux state.
  40. * @private
  41. * @returns {{
  42. * _showLabel: boolean
  43. * }}
  44. */
  45. export function _mapStateToProps(state: IReduxState) {
  46. return {
  47. _showLabel: state['features/transcribing'].isTranscribing
  48. };
  49. }
  50. export default translate(connect(_mapStateToProps)(TranscribingLabel));