From e8ee5c2f9625f27644c56dede6c3d33d89d3e745 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 5 Aug 2016 16:13:06 +0100 Subject: [PATCH] Add config to hide the labs section --- src/components/structures/MatrixChat.js | 11 ++++++++++- src/components/structures/UserSettings.js | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index 33e6499e21..b075db166f 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -139,6 +139,10 @@ module.exports = React.createClass({ return this.props.config.default_is_url || "https://vector.im"; }, + getEnableLabs() { + return this.props.config.enableLabs === undefined ? true : this.props.config.enableLabs; + }, + componentWillMount: function() { this.favicon = new Favico({animation: 'none'}); @@ -1060,7 +1064,12 @@ module.exports = React.createClass({ right_panel = break; case this.PageTypes.UserSettings: - page_element = + page_element = right_panel = break; case this.PageTypes.CreateRoom: diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 89146229fa..8ee9cbd2dc 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -50,11 +50,15 @@ module.exports = React.createClass({ onClose: React.PropTypes.func, // The brand string given when creating email pushers brand: React.PropTypes.string, + + // True to show the 'labs' section of experimental features + enableLabs: React.PropTypes.boolean, }, getDefaultProps: function() { return { - onClose: function() {} + onClose: function() {}, + enableLabs: true, }; }, @@ -359,6 +363,8 @@ module.exports = React.createClass({ }, _renderLabs: function () { + if (!this.props.enableLabs) return false; + let features = LABS_FEATURES.map(feature => (