File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 1616
1717/* Side panel styling */
1818.side-panel {
19- width : 30 % ;
19+ width : 400 px ;
2020 height : 100% ;
2121 background-color : var (--darker );
2222 color : var (--text-color );
138138/* Map controls styling */
139139.controls {
140140 position : absolute;
141- top : 20px ;
141+ bottom : 20px ;
142142 left : 20px ;
143143 z-index : 1000 ;
144+ background-color : var (--darkest );
144145}
145146
146147.controls input [type = "text" ] {
147148 padding : 10px ;
148149 font-size : 14px ;
149150 border-radius : 5px ;
150- border : 1px solid var (--border-color );
151- background-color : var (--input-background );
151+ border : 1px solid var (--darker );
152+ background-color : var (--dark );
152153 color : var (--text-color );
153154}
154155
Original file line number Diff line number Diff line change 1- import React , { useState } from "react" ;
1+ import React , { useState , useEffect } from "react" ;
22import { MapContainer , TileLayer , Marker , Tooltip } from "react-leaflet" ;
33import MarkerClusterGroup from "react-leaflet-markercluster" ;
44import "leaflet/dist/leaflet.css" ;
@@ -155,6 +155,11 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
155155 const [ searchTerm , setSearchTerm ] = useState ( "" ) ;
156156 const [ selectedData , setSelectedData ] = useState ( null ) ;
157157
158+ // Set initial position once when parentRef becomes available
159+ useEffect ( ( ) => {
160+ setSelectedData ( null ) ;
161+ } , [ selectedKPI ] ) ;
162+
158163 const interpolateColor = ( score ) => {
159164 const startColor = [ 247 , 118 , 142 ] ;
160165 const endColor = [ 115 , 218 , 202 ] ;
@@ -221,7 +226,7 @@ const WorldMap = ({ orchestrators, selectedKPI }) => {
221226 center = { [ 52.378 , 4.9 ] }
222227 maxZoom = { 10 }
223228 minZoom = { 2 }
224- style = { { height : "100%" , width : selectedData ? "70%" : " 100%" } } // Adjust width based on side panel
229+ style = { { height : "100%" , width : " 100%" } }
225230 >
226231 { /* Dark Theme Tiles */ }
227232 < TileLayer
You can’t perform that action at this time.
0 commit comments