jiti-meet/react/features/video-menu/components/AbstractKickButton.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-01-05 16:49:21 +00:00
// @flow
import { openDialog } from '../../base/dialog';
2019-08-30 16:39:06 +00:00
import { IconKick } from '../../base/icons';
2020-07-24 12:14:33 +00:00
import { AbstractButton, type AbstractButtonProps } from '../../base/toolbox/components';
2019-01-05 16:49:21 +00:00
import { KickRemoteParticipantDialog } from '.';
export type Props = AbstractButtonProps & {
/**
* The redux {@code dispatch} function.
*/
dispatch: Function,
/**
* The ID of the participant that this button is supposed to kick.
*/
participantID: string,
/**
* The function to be used to translate i18n labels.
*/
t: Function
};
/**
* An abstract remote video menu button which kicks the remote participant.
*/
export default class AbstractKickButton extends AbstractButton<Props, *> {
accessibilityLabel = 'toolbar.accessibilityLabel.kick';
2019-08-30 16:39:06 +00:00
icon = IconKick;
2019-01-05 16:49:21 +00:00
label = 'videothumbnail.kick';
/**
* Handles clicking / pressing the button, and kicks the participant.
*
* @private
* @returns {void}
*/
_handleClick() {
const { dispatch, participantID } = this.props;
dispatch(openDialog(KickRemoteParticipantDialog, { participantID }));
}
}