Переглянути джерело

rn,flags: feature flag to show/hide 'Tile View' button

j8
patidars 5 роки тому
джерело
коміт
8accd9e433
Аккаунт користувача з таким Email не знайдено

+ 6
- 0
react/features/base/flags/constants.js Переглянути файл

@@ -81,6 +81,12 @@ export const RAISE_HAND_ENABLED = 'raise-hand.enabled';
81 81
  */
82 82
 export const RECORDING_ENABLED = 'recording.enabled';
83 83
 
84
+/**
85
+ * Flag indicating if tile view feature should be enabled.
86
+ * Default: enabled.
87
+ */
88
+export const TILE_VIEW_ENABLED = 'tile-view.enabled';
89
+
84 90
 /**
85 91
  * Flag indicating if the welcome page should be enabled.
86 92
  * Default: disabled (false).

+ 9
- 5
react/features/video-layout/components/TileViewButton.js Переглянути файл

@@ -16,6 +16,7 @@ import {
16 16
 
17 17
 import { setTileView } from '../actions';
18 18
 import logger from '../logger';
19
+import { TILE_VIEW_ENABLED, getFeatureFlag } from '../../base/flags';
19 20
 
20 21
 /**
21 22
  * The type of the React {@code Component} props of {@link TileViewButton}.
@@ -83,13 +84,16 @@ class TileViewButton<P: Props> extends AbstractButton<P, *> {
83 84
  * {@code TileViewButton} component.
84 85
  *
85 86
  * @param {Object} state - The Redux state.
86
- * @returns {{
87
- *     _tileViewEnabled: boolean
88
- * }}
87
+ * @param {Object} ownProps - The properties explicitly passed to the component instance.
88
+ * @returns {Props}
89 89
  */
90
-function _mapStateToProps(state) {
90
+function _mapStateToProps(state, ownProps) {
91
+    const enabled = getFeatureFlag(state, TILE_VIEW_ENABLED, true);
92
+    const { visible = enabled } = ownProps;
93
+
91 94
     return {
92
-        _tileViewEnabled: state['features/video-layout'].tileViewEnabled
95
+        _tileViewEnabled: state['features/video-layout'].tileViewEnabled,
96
+        visible
93 97
     };
94 98
 }
95 99
 

Завантаження…
Відмінити
Зберегти