61
client/src/App/themeProvider.js
Normal file
61
client/src/App/themeProvider.js
Normal file
@@ -0,0 +1,61 @@
|
||||
import {defaultsDeep} from "lodash";
|
||||
import {theme} from "antd";
|
||||
|
||||
const {defaultAlgorithm, darkAlgorithm} = theme;
|
||||
|
||||
let isDarkMode = false;
|
||||
|
||||
/**
|
||||
* Default theme
|
||||
* @type {{components: {Menu: {itemDividerBorderColor: string}}}}
|
||||
*/
|
||||
const defaultTheme = {
|
||||
components: {
|
||||
Table: {
|
||||
rowHoverBg: '#e7f3ff',
|
||||
rowSelectedBg: '#e6f7ff',
|
||||
headerSortHoverBg: 'transparent',
|
||||
},
|
||||
Menu: {
|
||||
darkItemHoverBg: '#1677ff',
|
||||
itemHoverBg: '#1677ff',
|
||||
horizontalItemHoverBg: '#1677ff',
|
||||
}
|
||||
},
|
||||
token: {
|
||||
colorPrimary: "#326ade",
|
||||
colorInfo: "#326ade"
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Development theme
|
||||
* @type {{components: {Menu: {itemHoverBg: string, darkItemHoverBg: string, horizontalItemHoverBg: string}}, token: {colorPrimary: string}}}
|
||||
*/
|
||||
const devTheme = {
|
||||
components: {
|
||||
Menu: {
|
||||
darkItemHoverBg: '#a51d1d',
|
||||
itemHoverBg: '#a51d1d',
|
||||
horizontalItemHoverBg: '#a51d1d',
|
||||
}
|
||||
},
|
||||
token: {
|
||||
colorPrimary: '#a51d1d'
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Production theme
|
||||
* @type {{components: {Menu: {itemHoverBg: string, darkItemHoverBg: string, horizontalItemHoverBg: string}}, token: {colorPrimary: string}}}
|
||||
*/
|
||||
const prodTheme = {};
|
||||
|
||||
const currentTheme = process.env.NODE_ENV === "development" ? devTheme
|
||||
: prodTheme;
|
||||
|
||||
const finaltheme = {
|
||||
algorithm: isDarkMode ? darkAlgorithm : defaultAlgorithm,
|
||||
...defaultsDeep(currentTheme, defaultTheme)
|
||||
}
|
||||
export default finaltheme;
|
||||
Reference in New Issue
Block a user