diff --git a/web/react/components/user_settings/custom_theme_chooser.jsx b/web/react/components/user_settings/custom_theme_chooser.jsx index 095e5b6226..07e3fb24c7 100644 --- a/web/react/components/user_settings/custom_theme_chooser.jsx +++ b/web/react/components/user_settings/custom_theme_chooser.jsx @@ -55,26 +55,70 @@ export default class CustomThemeChooser extends React.Component { const elements = []; let colors = ''; Constants.THEME_ELEMENTS.forEach((element, index) => { - elements.push( -
- + if (element.id === 'codeTheme') { + const codeThemeOptions = []; + + element.themes.forEach((codeTheme, codeThemeIndex) => { + codeThemeOptions.push( + + ); + }); + + elements.push(
- - + +
+ + + + + + +
-
- ); + ); + } else { + elements.push( +
+ +
+ + +
+
+ ); + } colors += theme[element.id] + ','; }); diff --git a/web/react/components/user_settings/user_settings_appearance.jsx b/web/react/components/user_settings/user_settings_appearance.jsx index 425645c1f5..550c180c0c 100644 --- a/web/react/components/user_settings/user_settings_appearance.jsx +++ b/web/react/components/user_settings/user_settings_appearance.jsx @@ -203,12 +203,7 @@ export default class UserSettingsAppearance extends React.Component { {custom}
- {'Code Theme'} - -
+ {serverError} ); + /* {'Code Theme'} + +
*/ + return (
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index b8d346ba79..3cc76bd958 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -304,11 +304,33 @@ module.exports = { { id: 'mentionHighlightLink', uiName: 'Mention Highlight Link' + }, + { + id: 'codeTheme', + uiName: 'Code Theme', + themes: [ + { + id: 'solarized_dark', + uiName: 'Solarized Dark' + }, + { + id: 'solarized_light', + uiName: 'Solarized light' + }, + { + id: 'github', + uiName: 'GitHub' + }, + { + id: 'monokai', + uiName: 'Monokai' + } + ] } ], CODE_THEMES: { github: 'GitHub', - solarized_light: 'Solarized light', + solarized_light: 'Solarized Light', monokai: 'Monokai', solarized_dark: 'Solarized Dark' },