Browse Source

rn,flags: add feature flag to show/hide the 'Raise Hand' button

master
patidars 5 years ago
parent
commit
a18fd1cdb3
No account linked to committer's email address

+ 6
- 0
react/features/base/flags/constants.js View File

69
  */
69
  */
70
 export const PIP_ENABLED = 'pip.enabled';
70
 export const PIP_ENABLED = 'pip.enabled';
71
 
71
 
72
+/**
73
+ * Flag indicating if raise hand feature should be enabled.
74
+ * Default: enabled.
75
+ */
76
+export const RAISE_HAND_ENABLED = 'raise-hand.enabled';
77
+
72
 /**
78
 /**
73
  * Flag indicating if recording should be enabled.
79
  * Flag indicating if recording should be enabled.
74
  * Default: auto-detected.
80
  * Default: auto-detected.

+ 8
- 5
react/features/toolbox/components/native/RaiseHandButton.js View File

15
 import { connect } from '../../../base/redux';
15
 import { connect } from '../../../base/redux';
16
 import { AbstractButton } from '../../../base/toolbox';
16
 import { AbstractButton } from '../../../base/toolbox';
17
 import type { AbstractButtonProps } from '../../../base/toolbox';
17
 import type { AbstractButtonProps } from '../../../base/toolbox';
18
+import { RAISE_HAND_ENABLED, getFeatureFlag } from '../../../base/flags';
18
 
19
 
19
 /**
20
 /**
20
  * The type of the React {@code Component} props of {@link RaiseHandButton}.
21
  * The type of the React {@code Component} props of {@link RaiseHandButton}.
96
  * Maps part of the Redux state to the props of this component.
97
  * Maps part of the Redux state to the props of this component.
97
  *
98
  *
98
  * @param {Object} state - The Redux state.
99
  * @param {Object} state - The Redux state.
100
+ * @param {Object} ownProps - The properties explicitly passed to the component instance.
99
  * @private
101
  * @private
100
- * @returns {{
101
- *     _raisedHand: boolean
102
- * }}
102
+ * @returns {Props}
103
  */
103
  */
104
-function _mapStateToProps(state): Object {
104
+function _mapStateToProps(state, ownProps): Object {
105
     const _localParticipant = getLocalParticipant(state);
105
     const _localParticipant = getLocalParticipant(state);
106
+    const enabled = getFeatureFlag(state, RAISE_HAND_ENABLED, true);
107
+    const { visible = enabled } = ownProps;
106
 
108
 
107
     return {
109
     return {
108
         _localParticipant,
110
         _localParticipant,
109
-        _raisedHand: _localParticipant.raisedHand
111
+        _raisedHand: _localParticipant.raisedHand,
112
+        visible
110
     };
113
     };
111
 }
114
 }
112
 
115
 

Loading…
Cancel
Save