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

WaitForOwnerDialog.tsx 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import React, { Component } from 'react';
  2. import { connect } from 'react-redux';
  3. import { IStore } from '../../../app/types';
  4. import ConfirmDialog from '../../../base/dialog/components/native/ConfirmDialog';
  5. import { translate } from '../../../base/i18n/functions';
  6. import { cancelWaitForOwner, openLoginDialog } from '../../actions.native';
  7. /**
  8. * The type of the React {@code Component} props of {@link WaitForOwnerDialog}.
  9. */
  10. interface IProps {
  11. /**
  12. * Redux store dispatch function.
  13. */
  14. dispatch: IStore['dispatch'];
  15. /**
  16. * Invoked to obtain translated strings.
  17. */
  18. t: Function;
  19. }
  20. /**
  21. * The dialog is display in XMPP password + guest access configuration, after
  22. * user connects from anonymous domain and the conference does not exist yet.
  23. *
  24. * See {@link LoginDialog} description for more details.
  25. */
  26. class WaitForOwnerDialog extends Component<IProps> {
  27. /**
  28. * Initializes a new WaitForWonderDialog instance.
  29. *
  30. * @param {Object} props - The read-only properties with which the new
  31. * instance is to be initialized.
  32. */
  33. constructor(props: IProps) {
  34. super(props);
  35. // Bind event handlers so they are only bound once per instance.
  36. this._onCancel = this._onCancel.bind(this);
  37. this._onLogin = this._onLogin.bind(this);
  38. }
  39. /**
  40. * Implements React's {@link Component#render()}.
  41. *
  42. * @inheritdoc
  43. * @returns {ReactElement}
  44. */
  45. render() {
  46. return (
  47. <ConfirmDialog
  48. cancelLabel = 'dialog.Cancel'
  49. confirmLabel = 'dialog.IamHost'
  50. descriptionKey = 'dialog.WaitForHostMsg'
  51. onCancel = { this._onCancel }
  52. onSubmit = { this._onLogin } />
  53. );
  54. }
  55. /**
  56. * Called when the cancel button is clicked.
  57. *
  58. * @private
  59. * @returns {void}
  60. */
  61. _onCancel() {
  62. this.props.dispatch(cancelWaitForOwner());
  63. }
  64. /**
  65. * Called when the OK button is clicked.
  66. *
  67. * @private
  68. * @returns {void}
  69. */
  70. _onLogin() {
  71. this.props.dispatch(openLoginDialog());
  72. }
  73. }
  74. export default translate(connect()(WaitForOwnerDialog));