Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

MuteEveryoneDialog.tsx 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import React from 'react';
  2. import { ViewStyle } from 'react-native';
  3. import Dialog from 'react-native-dialog';
  4. import { Divider } from 'react-native-paper';
  5. import { connect } from 'react-redux';
  6. import ConfirmDialog from '../../../base/dialog/components/native/ConfirmDialog';
  7. import { translate } from '../../../base/i18n/functions';
  8. import AbstractMuteEveryoneDialog, {
  9. type IProps,
  10. abstractMapStateToProps as _mapStateToProps } from '../AbstractMuteEveryoneDialog';
  11. import styles from './styles';
  12. /**
  13. * A React Component with the contents for a dialog that asks for confirmation
  14. * from the user before muting all remote participants.
  15. *
  16. * @augments AbstractMuteEveryoneDialog
  17. */
  18. class MuteEveryoneDialog extends AbstractMuteEveryoneDialog<IProps> {
  19. /**
  20. * Renders the dialog switch.
  21. *
  22. * @returns {React$Component}
  23. */
  24. _renderSwitch() {
  25. return (
  26. this.props.exclude.length === 0
  27. && <Dialog.Switch
  28. label = { this.props.t('dialog.moderationAudioLabel') }
  29. onValueChange = { this._onToggleModeration }
  30. value = { !this.state.audioModerationEnabled } />
  31. );
  32. }
  33. /**
  34. * Implements {@code Component#render}.
  35. *
  36. * @inheritdoc
  37. */
  38. render() {
  39. return (
  40. <ConfirmDialog
  41. confirmLabel = 'dialog.muteParticipantButton'
  42. descriptionKey = { this.state.content }
  43. onSubmit = { this._onSubmit }
  44. title = { this.props.title } >
  45. {/* @ts-ignore */}
  46. <Divider style = { styles.dividerDialog as ViewStyle } />
  47. { this._renderSwitch() }
  48. </ConfirmDialog>
  49. );
  50. }
  51. }
  52. export default translate(connect(_mapStateToProps)(MuteEveryoneDialog));