Commit 121c8808 authored by afc163's avatar afc163 Committed by 陈帅

rename themeColor to primaryColor

parent 3bc8524f
......@@ -30,7 +30,7 @@ const ThemeColor = ({ colors, title, value, onChange }) => {
];
}
return (
<div className={styles.themeColor}>
<div className={styles.primaryColor}>
<h3 className={styles.title}>{title}</h3>
<div className={styles.content}>
{colorList.map(color => {
......
.themeColor {
.primaryColor {
overflow: hidden;
margin-top: 24px;
.title {
......
......@@ -113,7 +113,7 @@ class SettingDarwer extends PureComponent {
render() {
const { setting } = this.props;
const { collapse, silderTheme, themeColor, layout, colorWeak } = setting;
const { collapse, silderTheme, primaryColor, layout, colorWeak } = setting;
return (
<Drawer
visible={collapse}
......@@ -166,8 +166,8 @@ class SettingDarwer extends PureComponent {
<ThemeColor
title={formatMessage({ id: 'app.setting.themecolor' })}
value={themeColor}
onChange={color => this.changeSetting('themeColor', color)}
value={primaryColor}
onChange={color => this.changeSetting('primaryColor', color)}
/>
<Divider />
......
export default {
collapse: false,
silderTheme: 'dark',
themeColor: '#1890FF',
primaryColor: '#1890FF',
layout: 'sidemenu',
grid: 'Fluid',
fixedHeader: false,
......
......@@ -2,9 +2,9 @@ import { message } from 'antd';
import defaultSetting from '../defaultSetting';
let lessNodesAppended;
const updateTheme = themeColor => {
const updateTheme = primaryColor => {
// Determine if the component is remounted
if (!themeColor) {
if (!primaryColor) {
return;
}
const hideMessage = message.loading('正在编译主题!', 0);
......@@ -40,7 +40,7 @@ const updateTheme = themeColor => {
setTimeout(() => {
window.less
.modifyVars({
'@primary-color': themeColor,
'@primary-color': primaryColor,
})
.then(() => {
hideMessage();
......@@ -70,9 +70,9 @@ export default {
setting[key] = value === '1' ? true : value;
}
});
const { themeColor, colorWeak } = setting;
if (state.themeColor !== themeColor) {
updateTheme(themeColor);
const { primaryColor, colorWeak } = setting;
if (state.primaryColor !== primaryColor) {
updateTheme(primaryColor);
}
updateColorWeak(colorWeak);
return {
......@@ -99,9 +99,9 @@ export default {
urlParams.searchParams.set(key, value);
}
});
const { themeColor, colorWeak } = payload;
if (state.themeColor !== themeColor) {
updateTheme(themeColor);
const { primaryColor, colorWeak } = payload;
if (state.primaryColor !== primaryColor) {
updateTheme(primaryColor);
}
updateColorWeak(colorWeak);
window.history.replaceState(null, 'setting', urlParams.href);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment