Ver código fonte

fix(rn,reactions) don't show raise hand button in menu if disabled

factor2
Saúl Ibarra Corretgé 3 anos atrás
pai
commit
d1ac4ea637

+ 13
- 1
react/features/reactions/components/native/RaiseHandButton.js Ver arquivo

9
     sendAnalytics
9
     sendAnalytics
10
 } from '../../../analytics';
10
 } from '../../../analytics';
11
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
11
 import { ColorSchemeRegistry } from '../../../base/color-scheme';
12
+import { RAISE_HAND_ENABLED, getFeatureFlag } from '../../../base/flags';
12
 import { translate } from '../../../base/i18n';
13
 import { translate } from '../../../base/i18n';
13
 import {
14
 import {
14
     getLocalParticipant,
15
     getLocalParticipant,
25
  */
26
  */
26
 type Props = AbstractButtonProps & {
27
 type Props = AbstractButtonProps & {
27
 
28
 
29
+    /**
30
+     * Whether this button is enabled or not.
31
+     */
32
+    _enabled: boolean,
33
+
28
     /**
34
     /**
29
      * The local participant.
35
      * The local participant.
30
      */
36
      */
128
      * @returns {ReactElement}
134
      * @returns {ReactElement}
129
      */
135
      */
130
     render() {
136
     render() {
131
-        const { _styles, t } = this.props;
137
+        const { _enabled, _styles, t } = this.props;
138
+
139
+        if (!_enabled) {
140
+            return null;
141
+        }
132
 
142
 
133
         return (
143
         return (
134
             <TouchableHighlight
144
             <TouchableHighlight
155
  */
165
  */
156
 function _mapStateToProps(state): Object {
166
 function _mapStateToProps(state): Object {
157
     const _localParticipant = getLocalParticipant(state);
167
     const _localParticipant = getLocalParticipant(state);
168
+    const enabled = getFeatureFlag(state, RAISE_HAND_ENABLED, true);
158
 
169
 
159
     return {
170
     return {
171
+        _enabled: enabled,
160
         _localParticipant,
172
         _localParticipant,
161
         _raisedHand: hasRaisedHand(_localParticipant),
173
         _raisedHand: hasRaisedHand(_localParticipant),
162
         _styles: ColorSchemeRegistry.get(state, 'Toolbox').raiseHandButton
174
         _styles: ColorSchemeRegistry.get(state, 'Toolbox').raiseHandButton

Carregando…
Cancelar
Salvar