From a18fd1cdb39ee05696e262ef8a1f17c99f62b861 Mon Sep 17 00:00:00 2001 From: patidars Date: Mon, 4 May 2020 21:52:45 +0530 Subject: [PATCH] rn,flags: add feature flag to show/hide the 'Raise Hand' button --- react/features/base/flags/constants.js | 6 ++++++ .../toolbox/components/native/RaiseHandButton.js | 13 ++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/react/features/base/flags/constants.js b/react/features/base/flags/constants.js index 7cb793cfc..7621476c7 100644 --- a/react/features/base/flags/constants.js +++ b/react/features/base/flags/constants.js @@ -69,6 +69,12 @@ export const MEETING_PASSWORD_ENABLED = 'meeting-password.enabled'; */ export const PIP_ENABLED = 'pip.enabled'; +/** + * Flag indicating if raise hand feature should be enabled. + * Default: enabled. + */ +export const RAISE_HAND_ENABLED = 'raise-hand.enabled'; + /** * Flag indicating if recording should be enabled. * Default: auto-detected. diff --git a/react/features/toolbox/components/native/RaiseHandButton.js b/react/features/toolbox/components/native/RaiseHandButton.js index 3d5c1c77b..7e3fd85b7 100644 --- a/react/features/toolbox/components/native/RaiseHandButton.js +++ b/react/features/toolbox/components/native/RaiseHandButton.js @@ -15,6 +15,7 @@ import { import { connect } from '../../../base/redux'; import { AbstractButton } from '../../../base/toolbox'; import type { AbstractButtonProps } from '../../../base/toolbox'; +import { RAISE_HAND_ENABLED, getFeatureFlag } from '../../../base/flags'; /** * The type of the React {@code Component} props of {@link RaiseHandButton}. @@ -96,17 +97,19 @@ class RaiseHandButton extends AbstractButton { * Maps part of the Redux state to the props of this component. * * @param {Object} state - The Redux state. + * @param {Object} ownProps - The properties explicitly passed to the component instance. * @private - * @returns {{ - * _raisedHand: boolean - * }} + * @returns {Props} */ -function _mapStateToProps(state): Object { +function _mapStateToProps(state, ownProps): Object { const _localParticipant = getLocalParticipant(state); + const enabled = getFeatureFlag(state, RAISE_HAND_ENABLED, true); + const { visible = enabled } = ownProps; return { _localParticipant, - _raisedHand: _localParticipant.raisedHand + _raisedHand: _localParticipant.raisedHand, + visible }; }