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.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. * 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. <ConfirmDialog
  43. contentKey = 'calendarSync.confirmAddLink'
  44. onSubmit = { this._onSubmit } />
  45. );
  46. }
  47. _onSubmit: () => boolean;
  48. /**
  49. * Callback for the confirm button.
  50. *
  51. * @private
  52. * @returns {boolean} - True (to note that the modal should be closed).
  53. */
  54. _onSubmit() {
  55. this.props.dispatch(updateCalendarEvent(this.props.eventId, ''));
  56. return true;
  57. }
  58. }
  59. export default translate(connect()(UpdateCalendarEventDialog));