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 }) => { ...@@ -30,7 +30,7 @@ const ThemeColor = ({ colors, title, value, onChange }) => {
]; ];
} }
return ( return (
<div className={styles.themeColor}> <div className={styles.primaryColor}>
<h3 className={styles.title}>{title}</h3> <h3 className={styles.title}>{title}</h3>
<div className={styles.content}> <div className={styles.content}>
{colorList.map(color => { {colorList.map(color => {
......
.themeColor { .primaryColor {
overflow: hidden; overflow: hidden;
margin-top: 24px; margin-top: 24px;
.title { .title {
......
...@@ -113,7 +113,7 @@ class SettingDarwer extends PureComponent { ...@@ -113,7 +113,7 @@ class SettingDarwer extends PureComponent {
render() { render() {
const { setting } = this.props; const { setting } = this.props;
const { collapse, silderTheme, themeColor, layout, colorWeak } = setting; const { collapse, silderTheme, primaryColor, layout, colorWeak } = setting;
return ( return (
<Drawer <Drawer
visible={collapse} visible={collapse}
...@@ -166,8 +166,8 @@ class SettingDarwer extends PureComponent { ...@@ -166,8 +166,8 @@ class SettingDarwer extends PureComponent {
<ThemeColor <ThemeColor
title={formatMessage({ id: 'app.setting.themecolor' })} title={formatMessage({ id: 'app.setting.themecolor' })}
value={themeColor} value={primaryColor}
onChange={color => this.changeSetting('themeColor', color)} onChange={color => this.changeSetting('primaryColor', color)}
/> />
<Divider /> <Divider />
......
export default { export default {
collapse: false, collapse: false,
silderTheme: 'dark', silderTheme: 'dark',
themeColor: '#1890FF', primaryColor: '#1890FF',
layout: 'sidemenu', layout: 'sidemenu',
grid: 'Fluid', grid: 'Fluid',
fixedHeader: false, fixedHeader: false,
......
...@@ -2,9 +2,9 @@ import { message } from 'antd'; ...@@ -2,9 +2,9 @@ import { message } from 'antd';
import defaultSetting from '../defaultSetting'; import defaultSetting from '../defaultSetting';
let lessNodesAppended; let lessNodesAppended;
const updateTheme = themeColor => { const updateTheme = primaryColor => {
// Determine if the component is remounted // Determine if the component is remounted
if (!themeColor) { if (!primaryColor) {
return; return;
} }
const hideMessage = message.loading('ζ­£εœ¨ηΌ–θ―‘δΈ»ι’˜οΌ', 0); const hideMessage = message.loading('ζ­£εœ¨ηΌ–θ―‘δΈ»ι’˜οΌ', 0);
...@@ -40,7 +40,7 @@ const updateTheme = themeColor => { ...@@ -40,7 +40,7 @@ const updateTheme = themeColor => {
setTimeout(() => { setTimeout(() => {
window.less window.less
.modifyVars({ .modifyVars({
'@primary-color': themeColor, '@primary-color': primaryColor,
}) })
.then(() => { .then(() => {
hideMessage(); hideMessage();
...@@ -70,9 +70,9 @@ export default { ...@@ -70,9 +70,9 @@ export default {
setting[key] = value === '1' ? true : value; setting[key] = value === '1' ? true : value;
} }
}); });
const { themeColor, colorWeak } = setting; const { primaryColor, colorWeak } = setting;
if (state.themeColor !== themeColor) { if (state.primaryColor !== primaryColor) {
updateTheme(themeColor); updateTheme(primaryColor);
} }
updateColorWeak(colorWeak); updateColorWeak(colorWeak);
return { return {
...@@ -99,9 +99,9 @@ export default { ...@@ -99,9 +99,9 @@ export default {
urlParams.searchParams.set(key, value); urlParams.searchParams.set(key, value);
} }
}); });
const { themeColor, colorWeak } = payload; const { primaryColor, colorWeak } = payload;
if (state.themeColor !== themeColor) { if (state.primaryColor !== primaryColor) {
updateTheme(themeColor); updateTheme(primaryColor);
} }
updateColorWeak(colorWeak); updateColorWeak(colorWeak);
window.history.replaceState(null, 'setting', urlParams.href); 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