summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_settings/premade_theme_chooser.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/user_settings/premade_theme_chooser.jsx')
-rw-r--r--webapp/components/user_settings/premade_theme_chooser.jsx72
1 files changed, 0 insertions, 72 deletions
diff --git a/webapp/components/user_settings/premade_theme_chooser.jsx b/webapp/components/user_settings/premade_theme_chooser.jsx
deleted file mode 100644
index 1bb2c6be9..000000000
--- a/webapp/components/user_settings/premade_theme_chooser.jsx
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
-// See License.txt for license information.
-
-import $ from 'jquery';
-import * as Utils from 'utils/utils.jsx';
-import Constants from 'utils/constants.jsx';
-
-import PropTypes from 'prop-types';
-
-import React from 'react';
-
-export default class PremadeThemeChooser extends React.Component {
- constructor(props) {
- super(props);
- this.state = {};
- }
- render() {
- const theme = this.props.theme;
-
- const premadeThemes = [];
- const allowedThemes = global.mm_config.AllowedThemes ? global.mm_config.AllowedThemes.split(',') : [];
- const hasAllowedThemes = allowedThemes.length > 1 || (allowedThemes[0] && allowedThemes[0].trim().length > 0);
-
- for (const k in Constants.THEMES) {
- if (Constants.THEMES.hasOwnProperty(k)) {
- if (hasAllowedThemes && allowedThemes.indexOf(k) < 0) {
- continue;
- }
-
- const premadeTheme = $.extend(true, {}, Constants.THEMES[k]);
-
- let activeClass = '';
- if (premadeTheme.type === theme.type) {
- activeClass = 'active';
- }
-
- premadeThemes.push(
- <div
- className='col-xs-6 col-sm-3 premade-themes'
- key={'premade-theme-key' + k}
- >
- <div
- className={activeClass}
- onClick={() => this.props.updateTheme(premadeTheme)}
- >
- <label>
- <img
- className='img-responsive'
- src={premadeTheme.image}
- />
- <div className='theme-label'>{Utils.toTitleCase(premadeTheme.type)}</div>
- </label>
- </div>
- </div>
- );
- }
- }
-
- return (
- <div className='row appearance-section'>
- <div className='clearfix'>
- {premadeThemes}
- </div>
- </div>
- );
- }
-}
-
-PremadeThemeChooser.propTypes = {
- theme: PropTypes.object.isRequired,
- updateTheme: PropTypes.func.isRequired
-};