Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
ant-design-pro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
duanledexianxianxian
ant-design-pro
Commits
121c8808
Commit
121c8808
authored
Aug 28, 2018
by
afc163
Committed by
ιεΈ
Aug 29, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename themeColor to primaryColor
parent
3bc8524f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
15 deletions
+15
-15
src/components/SettingDrawer/ThemeColor.js
src/components/SettingDrawer/ThemeColor.js
+1
-1
src/components/SettingDrawer/ThemeColor.less
src/components/SettingDrawer/ThemeColor.less
+1
-1
src/components/SettingDrawer/index.js
src/components/SettingDrawer/index.js
+3
-3
src/defaultSetting.js
src/defaultSetting.js
+1
-1
src/models/setting.js
src/models/setting.js
+9
-9
No files found.
src/components/SettingDrawer/ThemeColor.js
View file @
121c8808
...
...
@@ -30,7 +30,7 @@ const ThemeColor = ({ colors, title, value, onChange }) => {
];
}
return
(
<
div
className
=
{
styles
.
theme
Color
}
>
<
div
className
=
{
styles
.
primary
Color
}
>
<
h3
className
=
{
styles
.
title
}
>
{
title
}
<
/h3
>
<
div
className
=
{
styles
.
content
}
>
{
colorList
.
map
(
color
=>
{
...
...
src/components/SettingDrawer/ThemeColor.less
View file @
121c8808
.
theme
Color {
.
primary
Color {
overflow: hidden;
margin-top: 24px;
.title {
...
...
src/components/SettingDrawer/index.js
View file @
121c8808
...
...
@@ -113,7 +113,7 @@ class SettingDarwer extends PureComponent {
render
()
{
const
{
setting
}
=
this
.
props
;
const
{
collapse
,
silderTheme
,
theme
Color
,
layout
,
colorWeak
}
=
setting
;
const
{
collapse
,
silderTheme
,
primary
Color
,
layout
,
colorWeak
}
=
setting
;
return
(
<
Drawer
visible
=
{
collapse
}
...
...
@@ -166,8 +166,8 @@ class SettingDarwer extends PureComponent {
<
ThemeColor
title
=
{
formatMessage
({
id
:
'
app.setting.themecolor
'
})}
value
=
{
theme
Color
}
onChange
=
{
color
=>
this
.
changeSetting
(
'
theme
Color
'
,
color
)}
value
=
{
primary
Color
}
onChange
=
{
color
=>
this
.
changeSetting
(
'
primary
Color
'
,
color
)}
/
>
<
Divider
/>
...
...
src/defaultSetting.js
View file @
121c8808
export
default
{
collapse
:
false
,
silderTheme
:
'
dark
'
,
theme
Color
:
'
#1890FF
'
,
primary
Color
:
'
#1890FF
'
,
layout
:
'
sidemenu
'
,
grid
:
'
Fluid
'
,
fixedHeader
:
false
,
...
...
src/models/setting.js
View file @
121c8808
...
...
@@ -2,9 +2,9 @@ import { message } from 'antd';
import
defaultSetting
from
'
../defaultSetting
'
;
let
lessNodesAppended
;
const
updateTheme
=
theme
Color
=>
{
const
updateTheme
=
primary
Color
=>
{
// Determine if the component is remounted
if
(
!
theme
Color
)
{
if
(
!
primary
Color
)
{
return
;
}
const
hideMessage
=
message
.
loading
(
'
ζ£ε¨ηΌθ―δΈ»ι’οΌ
'
,
0
);
...
...
@@ -40,7 +40,7 @@ const updateTheme = themeColor => {
setTimeout
(()
=>
{
window
.
less
.
modifyVars
({
'
@primary-color
'
:
theme
Color
,
'
@primary-color
'
:
primary
Color
,
})
.
then
(()
=>
{
hideMessage
();
...
...
@@ -70,9 +70,9 @@ export default {
setting
[
key
]
=
value
===
'
1
'
?
true
:
value
;
}
});
const
{
theme
Color
,
colorWeak
}
=
setting
;
if
(
state
.
themeColor
!==
theme
Color
)
{
updateTheme
(
theme
Color
);
const
{
primary
Color
,
colorWeak
}
=
setting
;
if
(
state
.
primaryColor
!==
primary
Color
)
{
updateTheme
(
primary
Color
);
}
updateColorWeak
(
colorWeak
);
return
{
...
...
@@ -99,9 +99,9 @@ export default {
urlParams
.
searchParams
.
set
(
key
,
value
);
}
});
const
{
theme
Color
,
colorWeak
}
=
payload
;
if
(
state
.
themeColor
!==
theme
Color
)
{
updateTheme
(
theme
Color
);
const
{
primary
Color
,
colorWeak
}
=
payload
;
if
(
state
.
primaryColor
!==
primary
Color
)
{
updateTheme
(
primary
Color
);
}
updateColorWeak
(
colorWeak
);
window
.
history
.
replaceState
(
null
,
'
setting
'
,
urlParams
.
href
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment