Skip to content

Commit e63cc23

Browse files
committed
fixups
1 parent 0d00d80 commit e63cc23

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/components/WorldMap.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Side panel styling */
1818
.side-panel {
19-
width: 30%;
19+
width: 400px;
2020
height: 100%;
2121
background-color: var(--darker);
2222
color: var(--text-color);
@@ -138,17 +138,18 @@
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

src/components/WorldMap.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from "react";
1+
import React, { useState, useEffect } from "react";
22
import { MapContainer, TileLayer, Marker, Tooltip } from "react-leaflet";
33
import MarkerClusterGroup from "react-leaflet-markercluster";
44
import "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

0 commit comments

Comments
 (0)