mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
site: improve primary color change experience
This commit is contained in:
parent
8a9e2c5784
commit
949d10dbf9
@ -331,18 +331,23 @@ class Footer extends React.Component<WrappedComponentProps> {
|
||||
}
|
||||
|
||||
handleColorChange = (color: string) => {
|
||||
const {
|
||||
intl: { messages },
|
||||
} = this.props;
|
||||
message.loading({
|
||||
content: messages['app.footer.primary-color-changing'],
|
||||
key: 'change-primary-color',
|
||||
});
|
||||
const changeColor = () => {
|
||||
const {
|
||||
intl: { messages },
|
||||
} = this.props;
|
||||
const hide = message.loading(messages['app.footer.primary-color-changing']);
|
||||
(window as any).less
|
||||
.modifyVars({
|
||||
'@primary-color': color,
|
||||
})
|
||||
.then(() => {
|
||||
hide();
|
||||
message.success(messages['app.footer.primary-color-changed']);
|
||||
message.success({
|
||||
content: messages['app.footer.primary-color-changed'],
|
||||
key: 'change-primary-color',
|
||||
});
|
||||
this.setState({ color });
|
||||
});
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user