chore: color markers based on state
This commit is contained in:
parent
f26a67633f
commit
ab6666bf0e
1 changed files with 14 additions and 1 deletions
|
|
@ -4,8 +4,21 @@ import { CircleMarker, Popup } from 'react-leaflet';
|
||||||
import theme from '../style/theme';
|
import theme from '../style/theme';
|
||||||
import { spacedataElementStruct } from '../redux/modules/spacedata';
|
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 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 = {
|
const style = {
|
||||||
container: {
|
container: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue