From 9deab7d5d568ad624da26ee6e62f0255e75eb8b0 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Mon, 22 Jan 2024 15:30:43 -0500 Subject: [PATCH] - Theme provider update Signed-off-by: Dave Richer --- client/src/App/App.styles.scss | 12 ------------ client/src/App/themeProvider.js | 18 ++++++++++++++++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/client/src/App/App.styles.scss b/client/src/App/App.styles.scss index 8eab784c9..c49788f4d 100644 --- a/client/src/App/App.styles.scss +++ b/client/src/App/App.styles.scss @@ -147,23 +147,11 @@ } } -//Update row highlighting on production board. -.ant-table-tbody > tr.ant-table-row:hover > td { - background: #e7f3ff !important; -} - -.ant-table-tbody > tr.ant-table-row-selected > td { - background: #e6f7ff !important; -} - .job-line-manual { color: tomato; font-style: italic; } -td.ant-table-column-sort { - background-color: transparent; -} .ant-table-tbody > tr.ant-table-row:nth-child(2n) > td { background-color: #f4f4f4; diff --git a/client/src/App/themeProvider.js b/client/src/App/themeProvider.js index 9bf301d61..a35278ea2 100644 --- a/client/src/App/themeProvider.js +++ b/client/src/App/themeProvider.js @@ -1,4 +1,9 @@ import {defaultsDeep} from "lodash"; +import {theme} from "antd"; + +const {defaultAlgorithm, darkAlgorithm} = theme; + +let isDarkMode = false; /** * Default theme @@ -6,6 +11,11 @@ import {defaultsDeep} from "lodash"; */ const defaultTheme = { components: { + Table: { + rowHoverBg: '#e7f3ff', + rowSelectedBg: '#e6f7ff', + headerSortHoverBg: 'transparent', + }, Menu: { darkItemHoverBg: '#1677ff', itemHoverBg: '#1677ff', @@ -40,7 +50,11 @@ const devTheme = { */ const prodTheme = {}; -const theme = process.env.NODE_ENV === "development" ? devTheme +const currentTheme = process.env.NODE_ENV === "development" ? devTheme : prodTheme; -export default defaultsDeep(theme, defaultTheme); \ No newline at end of file +const finaltheme = { + algorithm: isDarkMode ? darkAlgorithm : defaultAlgorithm, + ...defaultsDeep(currentTheme, defaultTheme) +} +export default finaltheme; \ No newline at end of file