您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

StopLiveStreamDialog.web.js 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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._onSubmit = this._onSubmit.bind(this);
  42. }
  43. /**
  44. * Implements React's {@link Component#render()}.
  45. *
  46. * @inheritdoc
  47. * @returns {ReactElement}
  48. */
  49. render() {
  50. return (
  51. <Dialog
  52. okTitleKey = 'dialog.stopLiveStreaming'
  53. onCancel = { this.props.onCancel }
  54. onSubmit = { this._onSubmit }
  55. titleKey = 'dialog.liveStreaming'
  56. width = 'small'>
  57. { this.props.t('dialog.stopStreamingWarning') }
  58. </Dialog>
  59. );
  60. }
  61. /**
  62. * Callback invoked when stopping of live streaming is confirmed.
  63. *
  64. * @private
  65. * @returns {boolean} True to close the modal.
  66. */
  67. _onSubmit() {
  68. this.props.onSubmit();
  69. return true;
  70. }
  71. }
  72. export default translate(StopLiveStreamDialog);