Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Add config to hide the labs section #393

Merged
merged 3 commits into from
Aug 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -1060,7 +1060,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.props.config.enableLabs}
/>
right_panel = <RightPanel collapsed={this.state.collapse_rhs} opacity={this.state.sideOpacity}/>
break;
case this.PageTypes.CreateRoom:
Expand Down
9 changes: 8 additions & 1 deletion src/components/structures/UserSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.bool,
},

getDefaultProps: function() {
return {
onClose: function() {}
onClose: function() {},
enableLabs: true,
};
},

Expand Down Expand Up @@ -359,6 +363,9 @@ module.exports = React.createClass({
},

_renderLabs: function () {
// default to enabled if undefined
if (this.props.enableLabs === false) return null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!this.props.enableLabs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intention was to make it default to enabled if it wasn't specified, which I'ver clarified in a comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if it's not specified, it will get the value from defaultProps

On 5 August 2016 17:19:32 BST, David Baker notifications@github.com wrote:

@@ -359,6 +363,8 @@ module.exports = React.createClass({
},

 _renderLabs: function () {
  •    if (this.props.enableLabs === false) return null;
    

Intention was to make it default to enabled if it wasn't specified,
which I'ver clarified in a comment.


You are receiving this because you were assigned.
Reply to this email directly or view it on GitHub:
https://github.com/matrix-org/matrix-react-sdk/pull/393/files/f8d02c1551ff9392be45a0cfed0fcd33d5078048#r73719512


let features = LABS_FEATURES.map(feature => (
<div key={feature.id} className="mx_UserSettings_toggle">
<input
Expand Down