allow code theme to be shareable
Этот коммит содержится в:
@@ -40,11 +40,12 @@ export default class CustomThemeChooser extends React.Component {
|
|||||||
const theme = {type: 'custom'};
|
const theme = {type: 'custom'};
|
||||||
let index = 0;
|
let index = 0;
|
||||||
Constants.THEME_ELEMENTS.forEach((element) => {
|
Constants.THEME_ELEMENTS.forEach((element) => {
|
||||||
if (index < colors.length) {
|
if (index < colors.length - 1) {
|
||||||
theme[element.id] = colors[index];
|
theme[element.id] = colors[index];
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
|
theme.codeTheme = colors[colors.length - 1];
|
||||||
|
|
||||||
this.props.updateTheme(theme);
|
this.props.updateTheme(theme);
|
||||||
}
|
}
|
||||||
@@ -78,6 +79,8 @@ export default class CustomThemeChooser extends React.Component {
|
|||||||
colors += theme[element.id] + ',';
|
colors += theme[element.id] + ',';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
colors += theme.codeTheme;
|
||||||
|
|
||||||
const pasteBox = (
|
const pasteBox = (
|
||||||
<div className='col-sm-12'>
|
<div className='col-sm-12'>
|
||||||
<label className='custom-label'>
|
<label className='custom-label'>
|
||||||
|
|||||||
@@ -100,7 +100,9 @@ export default class UserSettingsAppearance extends React.Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
updateTheme(theme) {
|
updateTheme(theme) {
|
||||||
theme.codeTheme = this.state.theme.codeTheme;
|
if (!theme.codeTheme) {
|
||||||
|
theme.codeTheme = this.state.theme.codeTheme;
|
||||||
|
}
|
||||||
this.setState({theme});
|
this.setState({theme});
|
||||||
Utils.applyTheme(theme);
|
Utils.applyTheme(theme);
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user