From da1d52d546121e6c36cca9dea90c4a3bc540b0b7 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 22 Jan 2016 09:10:08 -0600 Subject: PLT-7 adding lang selector --- .../user_settings/user_settings_display.jsx | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'web/react/components/user_settings/user_settings_display.jsx') diff --git a/web/react/components/user_settings/user_settings_display.jsx b/web/react/components/user_settings/user_settings_display.jsx index 1ff0a2913..b12eb2d9c 100644 --- a/web/react/components/user_settings/user_settings_display.jsx +++ b/web/react/components/user_settings/user_settings_display.jsx @@ -6,6 +6,7 @@ import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMax from '../setting_item_max.jsx'; import Constants from '../../utils/constants.jsx'; import PreferenceStore from '../../stores/preference_store.jsx'; +import ManageLanguages from './manage_languages.jsx'; import * as Utils from '../../utils/utils.jsx'; function getDisplayStateFromStores() { @@ -78,6 +79,7 @@ export default class UserSettingsDisplay extends React.Component { let clockSection; let nameFormatSection; let fontSection; + let languagesSection; if (this.props.activeSection === 'clock') { const clockFormat = [false, false]; @@ -292,6 +294,46 @@ export default class UserSettingsDisplay extends React.Component { ); } + if (this.props.activeSection === 'languages') { + var inputs = []; + inputs.push( + + ); + + languagesSection = ( + { + this.updateSection(''); + e.preventDefault(); + }} + /> + ); + } else { + var locale = 'English'; + Utils.languages().forEach((l) => { + if (l.value === this.props.user.locale) { + locale = l.name; + } + }); + + languagesSection = ( + { + this.updateSection('languages'); + }} + /> + ); + } + return (
@@ -324,6 +366,8 @@ export default class UserSettingsDisplay extends React.Component {
{nameFormatSection}
+ {languagesSection} +
); -- cgit v1.2.3-1-g7c22 From 058d6b24672ce22d72451607eef7c9dcc48a255a Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Fri, 22 Jan 2016 09:27:27 -0600 Subject: PLT-7 adding loc feature to preview --- .../user_settings/user_settings_display.jsx | 76 +++++++++++----------- 1 file changed, 39 insertions(+), 37 deletions(-) (limited to 'web/react/components/user_settings/user_settings_display.jsx') diff --git a/web/react/components/user_settings/user_settings_display.jsx b/web/react/components/user_settings/user_settings_display.jsx index b12eb2d9c..f2c2502fb 100644 --- a/web/react/components/user_settings/user_settings_display.jsx +++ b/web/react/components/user_settings/user_settings_display.jsx @@ -5,6 +5,7 @@ import {savePreferences} from '../../utils/client.jsx'; import SettingItemMin from '../setting_item_min.jsx'; import SettingItemMax from '../setting_item_max.jsx'; import Constants from '../../utils/constants.jsx'; +const PreReleaseFeatures = Constants.PRE_RELEASE_FEATURES; import PreferenceStore from '../../stores/preference_store.jsx'; import ManageLanguages from './manage_languages.jsx'; import * as Utils from '../../utils/utils.jsx'; @@ -294,44 +295,46 @@ export default class UserSettingsDisplay extends React.Component { ); } - if (this.props.activeSection === 'languages') { - var inputs = []; - inputs.push( - - ); + if (Utils.isFeatureEnabled(PreReleaseFeatures.LOC_PREVIEW)) { + if (this.props.activeSection === 'languages') { + var inputs = []; + inputs.push( + + ); - languagesSection = ( - { - this.updateSection(''); - e.preventDefault(); - }} - /> - ); - } else { - var locale = 'English'; - Utils.languages().forEach((l) => { - if (l.value === this.props.user.locale) { - locale = l.name; - } - }); + languagesSection = ( + { + this.updateSection(''); + e.preventDefault(); + }} + /> + ); + } else { + var locale = 'English'; + Utils.languages().forEach((l) => { + if (l.value === this.props.user.locale) { + locale = l.name; + } + }); - languagesSection = ( - { - this.updateSection('languages'); - }} - /> - ); + languagesSection = ( + { + this.updateSection('languages'); + }} + /> + ); + } } return ( @@ -367,7 +370,6 @@ export default class UserSettingsDisplay extends React.Component { {nameFormatSection}
{languagesSection} -
); -- cgit v1.2.3-1-g7c22