2018-09-04 07:29:48 +00:00
|
|
|
// @flow
|
|
|
|
|
|
|
|
import React, { Component } from 'react';
|
|
|
|
|
2018-10-18 08:31:38 +00:00
|
|
|
import { ConfirmDialog } from '../../base/dialog';
|
2018-09-04 07:29:48 +00:00
|
|
|
import { translate } from '../../base/i18n';
|
2019-03-21 16:38:29 +00:00
|
|
|
import { connect } from '../../base/redux';
|
2018-09-04 07:29:48 +00:00
|
|
|
|
|
|
|
import { updateCalendarEvent } from '../actions';
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The Redux dispatch function.
|
|
|
|
*/
|
|
|
|
dispatch: Function,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The ID of the event to be updated.
|
|
|
|
*/
|
|
|
|
eventId: string,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function to translate i18n labels.
|
|
|
|
*/
|
|
|
|
t: Function
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Component for the add Jitsi link confirm dialog.
|
|
|
|
*/
|
|
|
|
class UpdateCalendarEventDialog extends Component<Props> {
|
|
|
|
/**
|
|
|
|
* Initializes a new {@code UpdateCalendarEventDialog} instance.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
|
|
|
constructor(props: Props) {
|
|
|
|
super(props);
|
|
|
|
|
|
|
|
this._onSubmit = this._onSubmit.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
2018-10-18 08:31:38 +00:00
|
|
|
<ConfirmDialog
|
|
|
|
contentKey = 'calendarSync.confirmAddLink'
|
|
|
|
onSubmit = { this._onSubmit } />
|
2018-09-04 07:29:48 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
_onSubmit: () => boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback for the confirm button.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {boolean} - True (to note that the modal should be closed).
|
|
|
|
*/
|
|
|
|
_onSubmit() {
|
|
|
|
this.props.dispatch(updateCalendarEvent(this.props.eventId, ''));
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default translate(connect()(UpdateCalendarEventDialog));
|