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

StopLiveStreamDialog.web.js 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import PropTypes from 'prop-types';
  2. import React, { Component } from 'react';
  3. import { Dialog } from '../../../base/dialog';
  4. import { translate } from '../../../base/i18n';
  5. /**
  6. * A React Component for confirming the participant wishes to stop the currently
  7. * active live stream of the conference.
  8. *
  9. * @extends Component
  10. */
  11. class StopLiveStreamDialog extends Component {
  12. /**
  13. * {@code StopLiveStreamDialog} component's property types.
  14. *
  15. * @static
  16. */
  17. static propTypes = {
  18. /**
  19. * Callback to invoke when the dialog is dismissed without confirming
  20. * the live stream should be stopped.
  21. */
  22. onCancel: PropTypes.func,
  23. /**
  24. * Callback to invoke when confirming the live stream should be stopped.
  25. */
  26. onSubmit: PropTypes.func,
  27. /**
  28. * Invoked to obtain translated strings.
  29. */
  30. t: PropTypes.func
  31. };
  32. /**
  33. * Initializes a new {@code StopLiveStreamDialog} instance.
  34. *
  35. * @param {Object} props - The read-only properties with which the new
  36. * instance is to be initialized.
  37. */
  38. constructor(props) {
  39. super(props);
  40. // Bind event handler so it is only bound once for every instance.
  41. this._onCancel = this._onCancel.bind(this);
  42. this._onSubmit = this._onSubmit.bind(this);
  43. }
  44. /**
  45. * Implements React's {@link Component#render()}.
  46. *
  47. * @inheritdoc
  48. * @returns {ReactElement}
  49. */
  50. render() {
  51. return (
  52. <Dialog
  53. okTitleKey = 'dialog.stopLiveStreaming'
  54. onCancel = { this._onCancel }
  55. onSubmit = { this._onSubmit }
  56. titleKey = 'dialog.liveStreaming'
  57. width = 'small'>
  58. { this.props.t('dialog.stopStreamingWarning') }
  59. </Dialog>
  60. );
  61. }
  62. /**
  63. * Callback invoked when stopping of live streaming is canceled.
  64. *
  65. * @private
  66. * @returns {boolean} True to close the modal.
  67. */
  68. _onCancel() {
  69. this.props.onCancel();
  70. return true;
  71. }
  72. /**
  73. * Callback invoked when stopping of live streaming is confirmed.
  74. *
  75. * @private
  76. * @returns {boolean} True to close the modal.
  77. */
  78. _onSubmit() {
  79. this.props.onSubmit();
  80. return true;
  81. }
  82. }
  83. export default translate(StopLiveStreamDialog);