diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 9bb1388e76..305994aa0e 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -112,4 +112,12 @@ module.exports = { append: true, // We always append for email pushers since we don't want to stop other accounts notifying to the same email address }); }, + + isFeatureEnabled: function(feature: string): boolean { + return localStorage.getItem(`mx_labs_feature_${feature}`) === 'true'; + }, + + setFeatureEnabled: function(feature: string, enabled: boolean) { + localStorage.setItem(`mx_labs_feature_${feature}`, enabled); + } }; diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 635f9c5413..a320a02da8 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -26,6 +26,17 @@ var GeminiScrollbar = require('react-gemini-scrollbar'); var Email = require('../../email'); var AddThreepid = require('../../AddThreepid'); +const LABS_FEATURES = [ + { + name: 'Rich Text Editor', + id: 'rich_text_editor' + }, + { + name: 'End-to-End Encryption', + id: 'e2e_encryption' + } +]; + module.exports = React.createClass({ displayName: 'UserSettings', @@ -357,6 +368,30 @@ module.exports = React.createClass({ ); } + this._renderLabs = function () { + let features = LABS_FEATURES.map(feature => ( +
These are experimental features that may break in unexpected ways. Use with caution.
+ {features} +