diff --git a/frontend/src/components/Marker.jsx b/frontend/src/components/Marker.jsx index 3633038..6a51097 100644 --- a/frontend/src/components/Marker.jsx +++ b/frontend/src/components/Marker.jsx @@ -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: {