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

UpdateCalendarEventDialog.native.tsx 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. import React, { Component } from 'react';
  2. import { WithTranslation } from 'react-i18next';
  3. import { connect } from 'react-redux';
  4. import { IStore } from '../../app/types';
  5. import ConfirmDialog from '../../base/dialog/components/native/ConfirmDialog';
  6. import { translate } from '../../base/i18n/functions';
  7. import { updateCalendarEvent } from '../actions';
  8. interface IProps extends WithTranslation {
  9. /**
  10. * The Redux dispatch function.
  11. */
  12. dispatch: IStore['dispatch'];
  13. /**
  14. * The ID of the event to be updated.
  15. */
  16. eventId: string;
  17. }
  18. /**
  19. * Component for the add Jitsi link confirm dialog.
  20. */
  21. class UpdateCalendarEventDialog extends Component<IProps> {
  22. /**
  23. * Initializes a new {@code UpdateCalendarEventDialog} instance.
  24. *
  25. * @inheritdoc
  26. */
  27. constructor(props: IProps) {
  28. super(props);
  29. this._onSubmit = this._onSubmit.bind(this);
  30. }
  31. /**
  32. * Implements React's {@link Component#render()}.
  33. *
  34. * @inheritdoc
  35. * @returns {ReactElement}
  36. */
  37. render() {
  38. return (
  39. <ConfirmDialog
  40. descriptionKey = 'calendarSync.confirmAddLink'
  41. onSubmit = { this._onSubmit } />
  42. );
  43. }
  44. /**
  45. * Callback for the confirm button.
  46. *
  47. * @private
  48. * @returns {boolean} - True (to note that the modal should be closed).
  49. */
  50. _onSubmit() {
  51. this.props.dispatch(updateCalendarEvent(this.props.eventId));
  52. return true;
  53. }
  54. }
  55. export default translate(connect()(UpdateCalendarEventDialog));