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

ClosedCaptionButton.tsx 1.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import { connect } from 'react-redux';
  2. import { IReduxState } from '../../../app/types';
  3. import { CLOSE_CAPTIONS_ENABLED } from '../../../base/flags/constants';
  4. import { getFeatureFlag } from '../../../base/flags/functions';
  5. import { translate } from '../../../base/i18n/functions';
  6. import { IconSubtitles } from '../../../base/icons/svg';
  7. import { navigate }
  8. from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
  9. import { screen } from '../../../mobile/navigation/routes';
  10. import {
  11. AbstractClosedCaptionButton,
  12. _abstractMapStateToProps
  13. } from '../AbstractClosedCaptionButton';
  14. /**
  15. * A button which starts/stops the transcriptions.
  16. */
  17. class ClosedCaptionButton
  18. extends AbstractClosedCaptionButton {
  19. accessibilityLabel = 'toolbar.accessibilityLabel.cc';
  20. icon = IconSubtitles;
  21. label = 'toolbar.startSubtitles';
  22. labelProps = {
  23. language: this.props.t(this.props._language),
  24. languages: this.props.t(this.props.languages ?? ''),
  25. languagesHead: this.props.t(this.props.languagesHead ?? '')
  26. };
  27. /**
  28. * Toggle language selection dialog.
  29. *
  30. * @returns {void}
  31. */
  32. _handleClickOpenLanguageSelector() {
  33. navigate(screen.conference.subtitles);
  34. }
  35. }
  36. /**
  37. * Maps (parts of) the redux state to the associated props for this component.
  38. *
  39. * @param {Object} state - The redux state.
  40. * @param {Object} ownProps - The properties explicitly passed to the component
  41. * instance.
  42. * @private
  43. * @returns {Props}
  44. */
  45. export function mapStateToProps(state: IReduxState, ownProps: any) {
  46. const enabled = getFeatureFlag(state, CLOSE_CAPTIONS_ENABLED, true);
  47. const abstractProps = _abstractMapStateToProps(state, ownProps);
  48. return {
  49. ...abstractProps,
  50. visible: abstractProps.visible && enabled
  51. };
  52. }
  53. export default translate(connect(mapStateToProps)(ClosedCaptionButton));