aboutsummaryrefslogtreecommitdiff
path: root/modern/src/common
diff options
context:
space:
mode:
authorKieran Dodson <128472473+K-J-Dod24@users.noreply.github.com>2023-05-17 08:59:34 +0100
committerGitHub <noreply@github.com>2023-05-17 08:59:34 +0100
commit1cc52221d7962367622a88416cc0f1aef0ce7203 (patch)
tree931500079a3060643afc98ec3c82645ba619cac6 /modern/src/common
parente5f04f968af12035fe1291267567ea976fa16a17 (diff)
parenteb364d8726f6e79cede10b168ea2ae31bbbe696e (diff)
downloadtrackermap-web-1cc52221d7962367622a88416cc0f1aef0ce7203.tar.gz
trackermap-web-1cc52221d7962367622a88416cc0f1aef0ce7203.tar.bz2
trackermap-web-1cc52221d7962367622a88416cc0f1aef0ce7203.zip
Merge branch 'traccar:master' into Teltonika-io32-coolantTemp
Diffstat (limited to 'modern/src/common')
-rw-r--r--modern/src/common/attributes/usePositionAttributes.js4
-rw-r--r--modern/src/common/attributes/useServerAttributes.js18
-rw-r--r--modern/src/common/theme/index.js9
-rw-r--r--modern/src/common/theme/palette.js48
4 files changed, 51 insertions, 28 deletions
diff --git a/modern/src/common/attributes/usePositionAttributes.js b/modern/src/common/attributes/usePositionAttributes.js
index 2c3aa0f7..e08e91d5 100644
--- a/modern/src/common/attributes/usePositionAttributes.js
+++ b/modern/src/common/attributes/usePositionAttributes.js
@@ -152,6 +152,10 @@ export default (t) => useMemo(() => ({
name: t('positionSteps'),
type: 'number',
},
+ heartRate: {
+ name: t('positionHeartRate'),
+ type: 'number',
+ },
input: {
name: t('positionInput'),
type: 'number',
diff --git a/modern/src/common/attributes/useServerAttributes.js b/modern/src/common/attributes/useServerAttributes.js
index ba49e44d..76d5a157 100644
--- a/modern/src/common/attributes/useServerAttributes.js
+++ b/modern/src/common/attributes/useServerAttributes.js
@@ -1,6 +1,24 @@
import { useMemo } from 'react';
export default (t) => useMemo(() => ({
+ title: {
+ name: t('serverName'),
+ type: 'string',
+ },
+ description: {
+ name: t('serverDescription'),
+ type: 'string',
+ },
+ colorPrimary: {
+ name: t('serverColorPrimary'),
+ type: 'string',
+ subtype: 'color',
+ },
+ colorSecondary: {
+ name: t('serverColorSecondary'),
+ type: 'string',
+ subtype: 'color',
+ },
'ui.disableLoginLanguage': {
name: t('attributeUiDisableLoginLanguage'),
type: 'boolean',
diff --git a/modern/src/common/theme/index.js b/modern/src/common/theme/index.js
index 0cc999ad..0f163e7e 100644
--- a/modern/src/common/theme/index.js
+++ b/modern/src/common/theme/index.js
@@ -1,12 +1,11 @@
+import { useMemo } from 'react';
import { createTheme } from '@mui/material/styles';
import palette from './palette';
import dimensions from './dimensions';
import components from './components';
-const theme = createTheme({
- palette,
+export default (server) => useMemo(() => createTheme({
+ palette: palette(server),
dimensions,
components,
-});
-
-export default theme;
+}), [server]);
diff --git a/modern/src/common/theme/palette.js b/modern/src/common/theme/palette.js
index c6cb00d9..dfc8b9dd 100644
--- a/modern/src/common/theme/palette.js
+++ b/modern/src/common/theme/palette.js
@@ -2,28 +2,30 @@ import {
amber, grey, green, indigo, red, common,
} from '@mui/material/colors';
-const colors = {
- white: common.white,
- background: grey[50],
- primary: indigo[900],
- secondary: green[800],
- positive: green[500],
- medium: amber[700],
- negative: red[500],
- neutral: grey[500],
- geometry: '#3bb2d0',
-};
+export default (server) => {
+ const colors = {
+ white: common.white,
+ background: grey[50],
+ primary: server?.attributes?.colorPrimary || indigo[900],
+ secondary: server?.attributes?.colorSecondary || green[800],
+ positive: green[500],
+ medium: amber[700],
+ negative: red[500],
+ neutral: grey[500],
+ geometry: '#3bb2d0',
+ };
-export default {
- background: {
- default: colors.background,
- },
- primary: {
- main: colors.primary,
- },
- secondary: {
- main: colors.secondary,
- contrastText: colors.white,
- },
- colors,
+ return {
+ background: {
+ default: colors.background,
+ },
+ primary: {
+ main: colors.primary,
+ },
+ secondary: {
+ main: colors.secondary,
+ contrastText: colors.white,
+ },
+ colors,
+ };
};