Disable kick participant button for guests
This commit is contained in:
parent
011b7f9d00
commit
d0bc3da0f5
|
@ -208,6 +208,11 @@ var interfaceConfig = {
|
||||||
*/
|
*/
|
||||||
SHOW_CHROME_EXTENSION_BANNER: false
|
SHOW_CHROME_EXTENSION_BANNER: false
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When enabled, the kick participant button will not be presented for users without a JWT
|
||||||
|
*/
|
||||||
|
// HIDE_KICK_BUTTON_FOR_GUESTS: false
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* How many columns the tile view can expand to. The respected range is
|
* How many columns the tile view can expand to. The respected range is
|
||||||
* between 1 and 5.
|
* between 1 and 5.
|
||||||
|
|
|
@ -12,6 +12,8 @@ import AbstractKickButton, {
|
||||||
|
|
||||||
import RemoteVideoMenuButton from './RemoteVideoMenuButton';
|
import RemoteVideoMenuButton from './RemoteVideoMenuButton';
|
||||||
|
|
||||||
|
declare var interfaceConfig: Object;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Implements a React {@link Component} which displays a button for kicking out
|
* Implements a React {@link Component} which displays a button for kicking out
|
||||||
* a participant from the conference.
|
* a participant from the conference.
|
||||||
|
@ -41,7 +43,11 @@ class KickButton extends AbstractKickButton {
|
||||||
* @returns {ReactElement}
|
* @returns {ReactElement}
|
||||||
*/
|
*/
|
||||||
render() {
|
render() {
|
||||||
const { participantID, t } = this.props;
|
const { participantID, t, visible } = this.props;
|
||||||
|
|
||||||
|
if (!visible) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RemoteVideoMenuButton
|
<RemoteVideoMenuButton
|
||||||
|
@ -57,4 +63,21 @@ class KickButton extends AbstractKickButton {
|
||||||
_handleClick: () => void
|
_handleClick: () => void
|
||||||
}
|
}
|
||||||
|
|
||||||
export default translate(connect()(KickButton));
|
/**
|
||||||
|
* Maps (parts of) the redux state to {@link KickButton}'s React {@code Component}
|
||||||
|
* props.
|
||||||
|
*
|
||||||
|
* @param {Object} state - The redux store/state.
|
||||||
|
* @private
|
||||||
|
* @returns {Object}
|
||||||
|
*/
|
||||||
|
function _mapStateToProps(state: Object) {
|
||||||
|
const shouldHide = interfaceConfig.HIDE_KICK_BUTTON_FOR_GUESTS && state['features/base/jwt'].isGuest;
|
||||||
|
|
||||||
|
return {
|
||||||
|
visible: !shouldHide
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export default translate(connect(_mapStateToProps)(KickButton));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue