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

UpdateCalendarEventDialog.native.js 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { connect } from 'react-redux';
  4. import { Dialog, DialogContent } from '../../base/dialog';
  5. import { translate } from '../../base/i18n';
  6. import { updateCalendarEvent } from '../actions';
  7. type Props = {
  8. /**
  9. * The Redux dispatch function.
  10. */
  11. dispatch: Function,
  12. /**
  13. * The ID of the event to be updated.
  14. */
  15. eventId: string,
  16. /**
  17. * Function to translate i18n labels.
  18. */
  19. t: Function
  20. };
  21. /**
  22. * Component for the add Jitsi link confirm dialog.
  23. */
  24. class UpdateCalendarEventDialog extends Component<Props> {
  25. /**
  26. * Initializes a new {@code UpdateCalendarEventDialog} instance.
  27. *
  28. * @inheritdoc
  29. */
  30. constructor(props: Props) {
  31. super(props);
  32. this._onSubmit = this._onSubmit.bind(this);
  33. }
  34. /**
  35. * Implements React's {@link Component#render()}.
  36. *
  37. * @inheritdoc
  38. * @returns {ReactElement}
  39. */
  40. render() {
  41. return (
  42. <Dialog
  43. okTitleKey = 'dialog.confirm'
  44. onSubmit = { this._onSubmit }
  45. titleKey = 'calendarSync.confirmAddLinkTitle'
  46. width = 'small'>
  47. <DialogContent>
  48. { this.props.t('calendarSync.confirmAddLink') }
  49. </DialogContent>
  50. </Dialog>
  51. );
  52. }
  53. _onSubmit: () => boolean;
  54. /**
  55. * Callback for the confirm button.
  56. *
  57. * @private
  58. * @returns {boolean} - True (to note that the modal should be closed).
  59. */
  60. _onSubmit() {
  61. this.props.dispatch(updateCalendarEvent(this.props.eventId, ''));
  62. return true;
  63. }
  64. }
  65. export default translate(connect()(UpdateCalendarEventDialog));