mirror of
https://github.com/vector-im/element-web.git
synced 2025-10-17 18:32:20 +02:00
Add config to hide the labs section
This commit is contained in:
parent
ff02c21252
commit
e8ee5c2f96
@ -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 = <RightPanel roomId={this.state.currentRoomId} collapsed={this.state.collapse_rhs} opacity={this.state.sideOpacity} />
|
||||
break;
|
||||
case this.PageTypes.UserSettings:
|
||||
page_element = <UserSettings onClose={this.onUserSettingsClose} version={this.state.version} brand={this.props.config.brand} />
|
||||
page_element = <UserSettings
|
||||
onClose={this.onUserSettingsClose}
|
||||
version={this.state.version}
|
||||
brand={this.props.config.brand}
|
||||
enableLabs={this.getEnableLabs()}
|
||||
/>
|
||||
right_panel = <RightPanel collapsed={this.state.collapse_rhs} opacity={this.state.sideOpacity}/>
|
||||
break;
|
||||
case this.PageTypes.CreateRoom:
|
||||
|
@ -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 => (
|
||||
<div key={feature.id} className="mx_UserSettings_toggle">
|
||||
<input
|
||||
|
Loading…
x
Reference in New Issue
Block a user