From 7b8594debceb93a1fa400d48fe1dcff943bd5af6 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Jun 2025 23:44:25 +0200 Subject: Implement stop sheet modal for map stop interactions (#27) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com> Co-authored-by: Ariel Costas Guerrero --- src/frontend/app/root.tsx | 60 +++++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 25 deletions(-) (limited to 'src/frontend/app/root.tsx') diff --git a/src/frontend/app/root.tsx b/src/frontend/app/root.tsx index 8ffbe86..55c6c16 100644 --- a/src/frontend/app/root.tsx +++ b/src/frontend/app/root.tsx @@ -5,7 +5,7 @@ import { Meta, Outlet, Scripts, - ScrollRestoration + ScrollRestoration, } from "react-router"; import type { Route } from "./+types/root"; @@ -24,13 +24,14 @@ maplibregl.addProtocol("pmtiles", pmtiles.tile); import "./i18n"; -if ('serviceWorker' in navigator) { - navigator.serviceWorker.register('/sw.js') +if ("serviceWorker" in navigator) { + navigator.serviceWorker + .register("/sw.js") .then((registration) => { - console.log('Service Worker registered with scope:', registration.scope); + console.log("Service Worker registered with scope:", registration.scope); }) .catch((error) => { - console.error('Service Worker registration failed:', error); + console.error("Service Worker registration failed:", error); }); } @@ -54,15 +55,27 @@ export function Layout({ children }: { children: React.ReactNode }) { - - + + - - + + @@ -82,20 +95,20 @@ export function Layout({ children }: { children: React.ReactNode }) { ); } - // Helper: check if coordinates are within Vigo bounds - function isWithinVigo(lngLat: LngLatLike): boolean { - let lng: number, lat: number; - if (Array.isArray(lngLat)) { - [lng, lat] = lngLat; - } else if ('lng' in lngLat && 'lat' in lngLat) { - lng = lngLat.lng; - lat = lngLat.lat; - } else { - return false; - } - // Rough bounding box for Vigo - return lat >= 42.18 && lat <= 42.30 && lng >= -8.78 && lng <= -8.65; +// Helper: check if coordinates are within Vigo bounds +function isWithinVigo(lngLat: LngLatLike): boolean { + let lng: number, lat: number; + if (Array.isArray(lngLat)) { + [lng, lat] = lngLat; + } else if ("lng" in lngLat && "lat" in lngLat) { + lng = lngLat.lng; + lat = lngLat.lat; + } else { + return false; } + // Rough bounding box for Vigo + return lat >= 42.18 && lat <= 42.3 && lng >= -8.78 && lng <= -8.65; +} import NavBar from "./components/NavBar"; @@ -109,9 +122,6 @@ export default function App() { - - - ); } -- cgit v1.3