update frontend

This commit is contained in:
Your Name 2025-12-21 01:03:57 -05:00
parent 192217e23c
commit a9351196df
1 changed files with 40 additions and 0 deletions

View File

@ -0,0 +1,40 @@
import React from "react";
import "../../styles/mapControls.css";
function getCurrentTheme() {
if (typeof window === "undefined") return "blue";
try {
const saved = window.localStorage.getItem("sociowire:theme");
if (saved === "dark" || saved === "blue" || saved === "light") {
return saved;
}
} catch {
// tant pis
}
return "blue";
}
export default function MapControls({ onMySpot, onPostWire }) {
const theme = getCurrentTheme();
return (
<div className={`map-controls map-controls--${theme}`}>
<button
type="button"
className="map-controls__button map-controls__button--myspot"
onClick={onMySpot}
>
My spot
</button>
<button
type="button"
className="map-controls__button map-controls__button--wire"
onClick={onPostWire}
>
Put a wire
</button>
</div>
);
}