diff --git a/frontend/src/pages/MapPage/index.tsx b/frontend/src/pages/MapPage/index.tsx index 0c0ce78..af2f638 100644 --- a/frontend/src/pages/MapPage/index.tsx +++ b/frontend/src/pages/MapPage/index.tsx @@ -120,7 +120,11 @@ function MapPage({ login }) { (e) => { let node = e.target; while (node) { - if (node?.classList?.contains(styles.mapInfoBox)) { + if ( + [styles.mapInfoBox, styles.mapToolbar].some((className) => + node?.classList?.contains(className) + ) + ) { return; } node = node.parentNode; @@ -162,6 +166,16 @@ function MapPage({ login }) { layers.push(eventsTextLayer); } + const onToggleLayerSidebarButtonClick = useCallback( + (e) => { + e.stopPropagation(); + e.preventDefault(); + console.log("toggl;e"); + setLayerSidebar((v) => !v); + }, + [setLayerSidebar] + ); + if (!obsMapSource) { return null; } @@ -212,17 +226,14 @@ function MapPage({ login }) { )}
-
{layers.map((layer) => ( diff --git a/frontend/src/pages/MapPage/styles.module.less b/frontend/src/pages/MapPage/styles.module.less index 66d4b2c..9af8b42 100644 --- a/frontend/src/pages/MapPage/styles.module.less +++ b/frontend/src/pages/MapPage/styles.module.less @@ -31,3 +31,9 @@ width: 36rem; overflow: auto; } + +.mapToolbar { + position: absolute; + left: 16px; + top: 16px; +}