You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UpdateCalendarEventDialog.native.js 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. // @flow
  2. import React, { Component } from 'react';
  3. import { ConfirmDialog } from '../../base/dialog';
  4. import { translate } from '../../base/i18n';
  5. import { connect } from '../../base/redux';
  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. /**
  18. * Component for the add Jitsi link confirm dialog.
  19. */
  20. class UpdateCalendarEventDialog extends Component<Props> {
  21. /**
  22. * Initializes a new {@code UpdateCalendarEventDialog} instance.
  23. *
  24. * @inheritdoc
  25. */
  26. constructor(props: Props) {
  27. super(props);
  28. this._onSubmit = this._onSubmit.bind(this);
  29. }
  30. /**
  31. * Implements React's {@link Component#render()}.
  32. *
  33. * @inheritdoc
  34. * @returns {ReactElement}
  35. */
  36. render() {
  37. return (
  38. <ConfirmDialog
  39. descriptionKey = 'calendarSync.confirmAddLink'
  40. onSubmit = { this._onSubmit } />
  41. );
  42. }
  43. _onSubmit: () => boolean;
  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));