rn,flags: feature flag to show/hide 'Tile View' button
This commit is contained in:
parent
caabdadf19
commit
8accd9e433
|
@ -81,6 +81,12 @@ export const RAISE_HAND_ENABLED = 'raise-hand.enabled';
|
||||||
*/
|
*/
|
||||||
export const RECORDING_ENABLED = 'recording.enabled';
|
export const RECORDING_ENABLED = 'recording.enabled';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Flag indicating if tile view feature should be enabled.
|
||||||
|
* Default: enabled.
|
||||||
|
*/
|
||||||
|
export const TILE_VIEW_ENABLED = 'tile-view.enabled';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag indicating if the welcome page should be enabled.
|
* Flag indicating if the welcome page should be enabled.
|
||||||
* Default: disabled (false).
|
* Default: disabled (false).
|
||||||
|
|
|
@ -16,6 +16,7 @@ import {
|
||||||
|
|
||||||
import { setTileView } from '../actions';
|
import { setTileView } from '../actions';
|
||||||
import logger from '../logger';
|
import logger from '../logger';
|
||||||
|
import { TILE_VIEW_ENABLED, getFeatureFlag } from '../../base/flags';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The type of the React {@code Component} props of {@link TileViewButton}.
|
* The type of the React {@code Component} props of {@link TileViewButton}.
|
||||||
|
@ -83,13 +84,16 @@ class TileViewButton<P: Props> extends AbstractButton<P, *> {
|
||||||
* {@code TileViewButton} component.
|
* {@code TileViewButton} component.
|
||||||
*
|
*
|
||||||
* @param {Object} state - The Redux state.
|
* @param {Object} state - The Redux state.
|
||||||
* @returns {{
|
* @param {Object} ownProps - The properties explicitly passed to the component instance.
|
||||||
* _tileViewEnabled: boolean
|
* @returns {Props}
|
||||||
* }}
|
|
||||||
*/
|
*/
|
||||||
function _mapStateToProps(state) {
|
function _mapStateToProps(state, ownProps) {
|
||||||
|
const enabled = getFeatureFlag(state, TILE_VIEW_ENABLED, true);
|
||||||
|
const { visible = enabled } = ownProps;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
_tileViewEnabled: state['features/video-layout'].tileViewEnabled
|
_tileViewEnabled: state['features/video-layout'].tileViewEnabled,
|
||||||
|
visible
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue