2019-01-05 17:49:21 +01:00
|
|
|
import React from 'react';
|
2023-03-21 09:47:52 +02:00
|
|
|
import { connect } from 'react-redux';
|
2017-05-31 08:42:50 -07:00
|
|
|
|
2023-03-30 11:27:53 +03:00
|
|
|
import { translate } from '../../../base/i18n/functions';
|
|
|
|
|
import { IconUserDeleted } from '../../../base/icons/svg';
|
2022-10-06 13:09:40 +03:00
|
|
|
import ContextMenuItem from '../../../base/ui/components/web/ContextMenuItem';
|
2023-03-30 11:27:53 +03:00
|
|
|
import AbstractKickButton, { IProps } from '../AbstractKickButton';
|
2018-10-29 22:02:23 -07:00
|
|
|
|
2017-05-31 08:42:50 -07:00
|
|
|
/**
|
|
|
|
|
* Implements a React {@link Component} which displays a button for kicking out
|
|
|
|
|
* a participant from the conference.
|
|
|
|
|
*
|
2019-01-05 17:49:21 +01:00
|
|
|
* NOTE: At the time of writing this is a button that doesn't use the
|
|
|
|
|
* {@code AbstractButton} base component, but is inherited from the same
|
|
|
|
|
* super class ({@code AbstractKickButton} that extends {@code AbstractButton})
|
|
|
|
|
* for the sake of code sharing between web and mobile. Once web uses the
|
|
|
|
|
* {@code AbstractButton} base component, this can be fully removed.
|
2017-05-31 08:42:50 -07:00
|
|
|
*/
|
2019-01-05 17:49:21 +01:00
|
|
|
class KickButton extends AbstractKickButton {
|
2017-08-14 08:02:58 -07:00
|
|
|
/**
|
2019-01-05 17:49:21 +01:00
|
|
|
* Instantiates a new {@code Component}.
|
2017-08-14 08:02:58 -07:00
|
|
|
*
|
2019-01-05 17:49:21 +01:00
|
|
|
* @inheritdoc
|
2017-08-14 08:02:58 -07:00
|
|
|
*/
|
2023-03-30 11:27:53 +03:00
|
|
|
constructor(props: IProps) {
|
2017-08-14 08:02:58 -07:00
|
|
|
super(props);
|
|
|
|
|
|
2019-01-05 17:49:21 +01:00
|
|
|
this._handleClick = this._handleClick.bind(this);
|
2017-08-14 08:02:58 -07:00
|
|
|
}
|
|
|
|
|
|
2017-05-31 08:42:50 -07:00
|
|
|
/**
|
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
|
*
|
|
|
|
|
* @inheritdoc
|
|
|
|
|
* @returns {ReactElement}
|
|
|
|
|
*/
|
|
|
|
|
render() {
|
2020-11-05 12:18:16 -06:00
|
|
|
const { participantID, t } = this.props;
|
2017-05-31 08:42:50 -07:00
|
|
|
|
|
|
|
|
return (
|
2021-12-15 15:18:41 +02:00
|
|
|
<ContextMenuItem
|
|
|
|
|
accessibilityLabel = { t('videothumbnail.kick') }
|
|
|
|
|
className = 'kicklink'
|
2022-11-08 12:24:32 +02:00
|
|
|
icon = { IconUserDeleted }
|
2017-05-31 08:42:50 -07:00
|
|
|
id = { `ejectlink_${participantID}` }
|
2019-01-05 17:49:21 +01:00
|
|
|
// eslint-disable-next-line react/jsx-handler-names
|
2021-12-15 15:18:41 +02:00
|
|
|
onClick = { this._handleClick }
|
|
|
|
|
text = { t('videothumbnail.kick') } />
|
2017-05-31 08:42:50 -07:00
|
|
|
);
|
|
|
|
|
}
|
2017-08-14 08:02:58 -07:00
|
|
|
|
2021-11-04 22:10:43 +01:00
|
|
|
_handleClick: () => void;
|
2017-05-31 08:42:50 -07:00
|
|
|
}
|
2020-11-11 11:45:18 -06:00
|
|
|
export default translate(connect()(KickButton));
|