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

This commit is contained in:
patidars 2020-05-06 17:52:59 +05:30 committed by GitHub
parent caabdadf19
commit 8accd9e433
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -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).

View File

@ -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
}; };
} }