From 7153d94dad8c823adcf3d0f26d18e04847b231fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 6 Feb 2018 11:41:23 +0100 Subject: [PATCH] [RN] Add ability to enable /disable the toolbox --- .../toolbox/components/Toolbox.native.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/react/features/toolbox/components/Toolbox.native.js b/react/features/toolbox/components/Toolbox.native.js index c09fcd33b5..f16b685c02 100644 --- a/react/features/toolbox/components/Toolbox.native.js +++ b/react/features/toolbox/components/Toolbox.native.js @@ -65,6 +65,11 @@ class Toolbox extends Component { */ _audioOnly: PropTypes.bool, + /** + * Flag showing whether the toolbox is enabled or not. + */ + _enabled: PropTypes.bool, + /** * Flag showing whether room is locked. */ @@ -130,6 +135,10 @@ class Toolbox extends Component { * @returns {ReactElement} */ render() { + if (!this.props._enabled) { + return null; + } + const toolboxStyle = isNarrowAspectRatio(this) ? styles.toolboxNarrow @@ -441,6 +450,7 @@ function _mapDispatchToProps(dispatch) { */ function _mapStateToProps(state) { const conference = state['features/base/conference']; + const { enabled } = state['features/toolbox']; return { ...abstractMapStateToProps(state), @@ -454,6 +464,14 @@ function _mapStateToProps(state) { */ _audioOnly: Boolean(conference.audioOnly), + /** + * The indicator which determines whether the toolbox is enabled or not. + * + * @private + * @type {boolean} + */ + _enabled: enabled, + /** * The indicator which determines whether the conference is * locked/password-protected.