Selaa lähdekoodia

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

master
patidars 5 vuotta sitten
vanhempi
commit
a18fd1cdb3
No account linked to committer's email address

+ 6
- 0
react/features/base/flags/constants.js Näytä tiedosto

@@ -69,6 +69,12 @@ export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled';
69 69
  */
70 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 79
  * Flag indicating if recording should be enabled.
74 80
  * Default: auto-detected.

+ 8
- 5
react/features/toolbox/components/native/RaiseHandButton.js Näytä tiedosto

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

Loading…
Peruuta
Tallenna