mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
allow code theme to be shareable
This commit is contained in:
@@ -40,11 +40,12 @@ export default class CustomThemeChooser extends React.Component {
|
||||
const theme = {type: 'custom'};
|
||||
let index = 0;
|
||||
Constants.THEME_ELEMENTS.forEach((element) => {
|
||||
if (index < colors.length) {
|
||||
if (index < colors.length - 1) {
|
||||
theme[element.id] = colors[index];
|
||||
}
|
||||
index++;
|
||||
});
|
||||
theme.codeTheme = colors[colors.length - 1];
|
||||
|
||||
this.props.updateTheme(theme);
|
||||
}
|
||||
@@ -78,6 +79,8 @@ export default class CustomThemeChooser extends React.Component {
|
||||
colors += theme[element.id] + ',';
|
||||
});
|
||||
|
||||
colors += theme.codeTheme;
|
||||
|
||||
const pasteBox = (
|
||||
<div className='col-sm-12'>
|
||||
<label className='custom-label'>
|
||||
|
||||
@@ -100,7 +100,9 @@ export default class UserSettingsAppearance extends React.Component {
|
||||
);
|
||||
}
|
||||
updateTheme(theme) {
|
||||
theme.codeTheme = this.state.theme.codeTheme;
|
||||
if (!theme.codeTheme) {
|
||||
theme.codeTheme = this.state.theme.codeTheme;
|
||||
}
|
||||
this.setState({theme});
|
||||
Utils.applyTheme(theme);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user