瀏覽代碼

rn: hide invite button if the functionality is not available

master
Saúl Ibarra Corretgé 6 年之前
父節點
當前提交
1baa85b649
共有 1 個檔案被更改,包括 8 行新增21 行删除
  1. 8
    21
      react/features/invite/components/add-people-dialog/native/InviteButton.js

+ 8
- 21
react/features/invite/components/add-people-dialog/native/InviteButton.js 查看文件

12
 
12
 
13
 type Props = AbstractButtonProps & {
13
 type Props = AbstractButtonProps & {
14
 
14
 
15
-    /**
16
-     * Whether or not the feature to invite people to join the
17
-     * conference is available.
18
-     */
19
-    _addPeopleEnabled: boolean,
20
-
21
     /**
15
     /**
22
      * The Redux dispatch function.
16
      * The Redux dispatch function.
23
      */
17
      */
42
     _handleClick() {
36
     _handleClick() {
43
         this.props.dispatch(setAddPeopleDialogVisible(true));
37
         this.props.dispatch(setAddPeopleDialogVisible(true));
44
     }
38
     }
45
-
46
-    /**
47
-     * Returns true if none of the invite methods are available.
48
-     *
49
-     * @protected
50
-     * @returns {boolean}
51
-     */
52
-    _isDisabled() {
53
-        return !this.props._addPeopleEnabled;
54
-    }
55
 }
39
 }
56
 
40
 
57
 /**
41
 /**
59
  * props.
43
  * props.
60
  *
44
  *
61
  * @param {Object} state - The redux store/state.
45
  * @param {Object} state - The redux store/state.
46
+ * @param {Object} ownProps - The properties explicitly passed to the component
47
+ * instance.
62
  * @private
48
  * @private
63
- * @returns {{
64
- *   _addPeopleEnabled: boolean
65
- * }}
49
+ * @returns {Object}
66
  */
50
  */
67
-function _mapStateToProps(state) {
51
+function _mapStateToProps(state: Object, ownProps: Object) {
52
+    const addPeopleEnabled = isAddPeopleEnabled(state) || isDialOutEnabled(state);
53
+    const { visible = Boolean(addPeopleEnabled) } = ownProps;
54
+
68
     return {
55
     return {
69
-        _addPeopleEnabled: isAddPeopleEnabled(state) || isDialOutEnabled(state)
56
+        visible
70
     };
57
     };
71
 }
58
 }
72
 
59
 

Loading…
取消
儲存