2019-01-05 16:49:21 +00:00
|
|
|
import { Component } from 'react';
|
2022-10-11 08:24:11 +00:00
|
|
|
import { WithTranslation } from 'react-i18next';
|
2019-01-05 16:49:21 +00:00
|
|
|
|
2022-10-11 08:24:11 +00:00
|
|
|
import { createRemoteVideoMenuButtonEvent } from '../../analytics/AnalyticsEvents';
|
|
|
|
import { sendAnalytics } from '../../analytics/functions';
|
|
|
|
import { IStore } from '../../app/types';
|
|
|
|
import { kickParticipant } from '../../base/participants/actions';
|
2019-01-05 16:49:21 +00:00
|
|
|
|
2022-10-20 09:11:27 +00:00
|
|
|
interface IProps extends WithTranslation {
|
2019-01-05 16:49:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The Redux dispatch function.
|
|
|
|
*/
|
2022-10-11 08:24:11 +00:00
|
|
|
dispatch: IStore['dispatch'];
|
2019-01-05 16:49:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The ID of the remote participant to be kicked.
|
|
|
|
*/
|
2022-10-11 08:24:11 +00:00
|
|
|
participantID: string;
|
|
|
|
}
|
2019-01-05 16:49:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Abstract dialog to confirm a remote participant kick action.
|
|
|
|
*/
|
|
|
|
export default class AbstractKickRemoteParticipantDialog
|
2022-10-20 09:11:27 +00:00
|
|
|
extends Component<IProps> {
|
2019-01-05 16:49:21 +00:00
|
|
|
/**
|
|
|
|
* Initializes a new {@code AbstractKickRemoteParticipantDialog} instance.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
*/
|
2022-10-20 09:11:27 +00:00
|
|
|
constructor(props: IProps) {
|
2019-01-05 16:49:21 +00:00
|
|
|
super(props);
|
|
|
|
|
|
|
|
this._onSubmit = this._onSubmit.bind(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Callback for the confirm button.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @returns {boolean} - True (to note that the modal should be closed).
|
|
|
|
*/
|
|
|
|
_onSubmit() {
|
|
|
|
const { dispatch, participantID } = this.props;
|
|
|
|
|
|
|
|
sendAnalytics(createRemoteVideoMenuButtonEvent(
|
|
|
|
'kick.button',
|
|
|
|
{
|
|
|
|
'participant_id': participantID
|
|
|
|
}));
|
|
|
|
|
|
|
|
dispatch(kickParticipant(participantID));
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|