aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-03-06 15:12:43 -0800
committerAnton Tananaev <anton@traccar.org>2023-03-06 15:12:43 -0800
commitec49b28e2da2dfb66b00e89d74faa9f62a432c5b (patch)
treeaaa6444ceeb155e04edcc170b64bee43fbbfcbe5
parent0ca058f1c69827b41fa3a414917ab1cbebfb84e6 (diff)
downloadtrackermap-web-ec49b28e2da2dfb66b00e89d74faa9f62a432c5b.tar.gz
trackermap-web-ec49b28e2da2dfb66b00e89d74faa9f62a432c5b.tar.bz2
trackermap-web-ec49b28e2da2dfb66b00e89d74faa9f62a432c5b.zip
Smaller icons on desktop
-rw-r--r--modern/src/map/MapPositions.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/modern/src/map/MapPositions.js b/modern/src/map/MapPositions.js
index ba510209..ec319939 100644
--- a/modern/src/map/MapPositions.js
+++ b/modern/src/map/MapPositions.js
@@ -1,5 +1,7 @@
import { useId, useCallback, useEffect } from 'react';
import { useSelector } from 'react-redux';
+import { useMediaQuery } from '@mui/material';
+import { useTheme } from '@mui/styles';
import { map } from './core/MapView';
import { formatTime, getStatusColor } from '../common/util/formatter';
import { mapIconKey } from './core/preloadImages';
@@ -11,9 +13,12 @@ const MapPositions = ({ positions, onClick, showStatus, selectedPosition, titleF
const clusters = `${id}-clusters`;
const direction = `${id}-direction`;
+ const theme = useTheme();
+ const desktop = useMediaQuery(theme.breakpoints.up('md'));
+
const devices = useSelector((state) => state.devices.items);
- const iconScale = useAttributePreference('iconScale', 1);
+ const iconScale = useAttributePreference('iconScale', desktop ? 0.75 : 1);
const mapCluster = useAttributePreference('mapCluster', true);
const hours12 = usePreference('twelveHourFormat');
const directionType = useAttributePreference('mapDirection', 'selected');