瀏覽代碼

Disable kick participant button for guests

master
Horatiu Muresan 5 年之前
父節點
當前提交
d0bc3da0f5
共有 2 個檔案被更改,包括 30 行新增2 行删除
  1. 5
    0
      interface_config.js
  2. 25
    2
      react/features/remote-video-menu/components/web/KickButton.js

+ 5
- 0
interface_config.js 查看文件

@@ -208,6 +208,11 @@ var interfaceConfig = {
208 208
     */
209 209
     SHOW_CHROME_EXTENSION_BANNER: false
210 210
 
211
+    /**
212
+     * When enabled, the kick participant button will not be presented for users without a JWT
213
+     */
214
+    // HIDE_KICK_BUTTON_FOR_GUESTS: false
215
+
211 216
     /**
212 217
      * How many columns the tile view can expand to. The respected range is
213 218
      * between 1 and 5.

+ 25
- 2
react/features/remote-video-menu/components/web/KickButton.js 查看文件

@@ -12,6 +12,8 @@ import AbstractKickButton, {
12 12
 
13 13
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
14 14
 
15
+declare var interfaceConfig: Object;
16
+
15 17
 /**
16 18
  * Implements a React {@link Component} which displays a button for kicking out
17 19
  * a participant from the conference.
@@ -41,7 +43,11 @@ class KickButton extends AbstractKickButton {
41 43
      * @returns {ReactElement}
42 44
      */
43 45
     render() {
44
-        const { participantID, t } = this.props;
46
+        const { participantID, t, visible } = this.props;
47
+
48
+        if (!visible) {
49
+            return null;
50
+        }
45 51
 
46 52
         return (
47 53
             <RemoteVideoMenuButton
@@ -57,4 +63,21 @@ class KickButton extends AbstractKickButton {
57 63
     _handleClick: () => void
58 64
 }
59 65
 
60
-export default translate(connect()(KickButton));
66
+/**
67
+ * Maps (parts of) the redux state to {@link KickButton}'s React {@code Component}
68
+ * props.
69
+ *
70
+ * @param {Object} state - The redux store/state.
71
+ * @private
72
+ * @returns {Object}
73
+ */
74
+function _mapStateToProps(state: Object) {
75
+    const shouldHide = interfaceConfig.HIDE_KICK_BUTTON_FOR_GUESTS && state['features/base/jwt'].isGuest;
76
+
77
+    return {
78
+        visible: !shouldHide
79
+    };
80
+}
81
+
82
+export default translate(connect(_mapStateToProps)(KickButton));
83
+

Loading…
取消
儲存