diff --git a/interface_config.js b/interface_config.js index a87ecaf71..f6b7dde25 100644 --- a/interface_config.js +++ b/interface_config.js @@ -208,6 +208,11 @@ var interfaceConfig = { */ 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 * between 1 and 5. diff --git a/react/features/remote-video-menu/components/web/KickButton.js b/react/features/remote-video-menu/components/web/KickButton.js index e687372b0..12272e48c 100644 --- a/react/features/remote-video-menu/components/web/KickButton.js +++ b/react/features/remote-video-menu/components/web/KickButton.js @@ -12,6 +12,8 @@ import AbstractKickButton, { import RemoteVideoMenuButton from './RemoteVideoMenuButton'; +declare var interfaceConfig: Object; + /** * Implements a React {@link Component} which displays a button for kicking out * a participant from the conference. @@ -41,7 +43,11 @@ class KickButton extends AbstractKickButton { * @returns {ReactElement} */ render() { - const { participantID, t } = this.props; + const { participantID, t, visible } = this.props; + + if (!visible) { + return null; + } return ( 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)); +