chore: color markers based on state

This commit is contained in:
Andreas Hubel 2023-09-23 18:11:57 +02:00
commit ab6666bf0e

View file

@ -4,8 +4,21 @@ import { CircleMarker, Popup } from 'react-leaflet';
import theme from '../style/theme';
import { spacedataElementStruct } from '../redux/modules/spacedata';
const markerColor = (spacedata) => {
switch (spacedata.state?.open) {
case true:
return theme.palette.secondary.light;
case false:
return theme.palette.error.light;
default:
return theme.palette.primary.main;
}
};
const Marker = (props) => {
const color = props.highlight ? theme.palette.secondary.light : theme.palette.primary.main;
// change color based on space status
const color = markerColor(props.spacedata);
// const color = props.highlight ? theme.palette.secondary.light :
const style = {
container: {