aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/PositionsMap.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-04-16 16:08:03 -0700
committerAnton Tananaev <anton@traccar.org>2022-04-16 16:08:03 -0700
commit838e1b969162b73b1bbafab75203998e7bf60979 (patch)
treebf99356e4040fd836c4775777f170c06e3460136 /modern/src/map/PositionsMap.js
parentdaacba8e25f5c60c77fab15e9392f43be3fa7a67 (diff)
downloadtrackermap-web-838e1b969162b73b1bbafab75203998e7bf60979.tar.gz
trackermap-web-838e1b969162b73b1bbafab75203998e7bf60979.tar.bz2
trackermap-web-838e1b969162b73b1bbafab75203998e7bf60979.zip
Clean up palette and colors
Diffstat (limited to 'modern/src/map/PositionsMap.js')
-rw-r--r--modern/src/map/PositionsMap.js14
1 files changed, 2 insertions, 12 deletions
diff --git a/modern/src/map/PositionsMap.js b/modern/src/map/PositionsMap.js
index 8d100534..791c7abe 100644
--- a/modern/src/map/PositionsMap.js
+++ b/modern/src/map/PositionsMap.js
@@ -9,6 +9,7 @@ import { map } from './Map';
import store from '../store';
import StatusView from './StatusView';
import theme from '../theme';
+import { getStatusColor } from '../common/formatter';
const PositionsMap = ({ positions }) => {
const id = 'positions';
@@ -17,24 +18,13 @@ const PositionsMap = ({ positions }) => {
const history = useHistory();
const devices = useSelector((state) => state.devices.items);
- const deviceColor = (device) => {
- switch (device.status) {
- case 'online':
- return 'green';
- case 'offline':
- return 'red';
- default:
- return 'gray';
- }
- };
-
const createFeature = (devices, position) => {
const device = devices[position.deviceId];
return {
deviceId: position.deviceId,
name: device.name,
category: device.category || 'default',
- color: deviceColor(device),
+ color: getStatusColor(device.status),
};
};