aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common/theme
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-08-27 17:08:08 -0700
committerAnton Tananaev <anton@traccar.org>2023-08-27 17:08:08 -0700
commitd257aa2fb592c8def4ff40630914127575b87062 (patch)
treed55efd2bd145a9565bb4bc0d1f1f336bbf53dd2a /modern/src/common/theme
parent778d626e5ca58f62b75ef070c5c347afa89a6de4 (diff)
downloadtrackermap-web-d257aa2fb592c8def4ff40630914127575b87062.tar.gz
trackermap-web-d257aa2fb592c8def4ff40630914127575b87062.tar.bz2
trackermap-web-d257aa2fb592c8def4ff40630914127575b87062.zip
Streamline theme palette
Diffstat (limited to 'modern/src/common/theme')
-rw-r--r--modern/src/common/theme/palette.js25
1 files changed, 9 insertions, 16 deletions
diff --git a/modern/src/common/theme/palette.js b/modern/src/common/theme/palette.js
index 99288aee..7bd63dac 100644
--- a/modern/src/common/theme/palette.js
+++ b/modern/src/common/theme/palette.js
@@ -1,7 +1,5 @@
import { useMediaQuery } from '@mui/material';
-import {
- amber, grey, green, indigo, red,
-} from '@mui/material/colors';
+import { grey, green, indigo } from '@mui/material/colors';
const validatedColor = (color) => (/^#([0-9A-Fa-f]{3}){1,2}$/.test(color) ? color : null);
@@ -10,27 +8,22 @@ export default (server) => {
const serverDarkMode = server?.attributes?.darkMode;
const darkMode = serverDarkMode !== undefined ? serverDarkMode : preferDarkMode;
- const colors = {
- primary: validatedColor(server?.attributes?.colorPrimary) || (darkMode ? indigo[200] : indigo[900]),
- secondary: validatedColor(server?.attributes?.colorSecondary) || (darkMode ? green[200] : green[800]),
- positive: green[500],
- medium: amber[700],
- negative: red[500],
- neutral: grey[500],
- geometry: '#3bb2d0',
- };
-
return {
mode: darkMode ? 'dark' : 'light',
background: {
default: darkMode ? grey[900] : grey[50],
},
primary: {
- main: colors.primary,
+ main: validatedColor(server?.attributes?.colorPrimary) || (darkMode ? indigo[200] : indigo[900]),
},
secondary: {
- main: colors.secondary,
+ main: validatedColor(server?.attributes?.colorSecondary) || (darkMode ? green[200] : green[800]),
+ },
+ neutral: {
+ main: grey[500],
+ },
+ geometry: {
+ main: '#3bb2d0',
},
- colors,
};
};