diff options
Diffstat (limited to 'src/frontend/app/routes')
| -rw-r--r-- | src/frontend/app/routes/home.css | 2 | ||||
| -rw-r--r-- | src/frontend/app/routes/map.tsx | 42 | ||||
| -rw-r--r-- | src/frontend/app/routes/stops-$id.css | 3 | ||||
| -rw-r--r-- | src/frontend/app/routes/stops-$id.tsx | 19 |
4 files changed, 44 insertions, 22 deletions
diff --git a/src/frontend/app/routes/home.css b/src/frontend/app/routes/home.css index 253c0ab..3d5ba3a 100644 --- a/src/frontend/app/routes/home.css +++ b/src/frontend/app/routes/home.css @@ -1,6 +1,6 @@ /* Common page styles */ .page-title { - font-size: 1.8rem; + font-size: 1.4rem; margin-bottom: 1rem; font-weight: 600; color: var(--text-color); diff --git a/src/frontend/app/routes/map.tsx b/src/frontend/app/routes/map.tsx index 5a8c7a2..b8fb881 100644 --- a/src/frontend/app/routes/map.tsx +++ b/src/frontend/app/routes/map.tsx @@ -1,22 +1,21 @@ import StopDataProvider, { type Stop } from "../data/StopDataProvider"; import "./map.css"; +import { loadStyle } from "app/maps/styleloader"; +import type { Feature as GeoJsonFeature, Point } from "geojson"; import { useEffect, useRef, useState } from "react"; -import { useApp } from "~/AppContext"; +import { useTranslation } from "react-i18next"; import Map, { - AttributionControl, - GeolocateControl, - Layer, - NavigationControl, - Source, - type MapRef, - type MapLayerMouseEvent, - type StyleSpecification, + GeolocateControl, + Layer, + NavigationControl, + Source, + type MapLayerMouseEvent, + type MapRef, + type StyleSpecification } from "react-map-gl/maplibre"; -import { loadStyle } from "app/maps/styleloader"; -import type { Feature as GeoJsonFeature, Point } from "geojson"; +import { useApp } from "~/AppContext"; import { StopSheet } from "~/components/StopSheet"; -import { useTranslation } from "react-i18next"; import { REGIONS } from "~/data/RegionConfig"; // Default minimal fallback style before dynamic loading @@ -96,10 +95,26 @@ export default function StopMap() { updateMapState([center.lat, center.lng], zoom); }; + const handleStyleImageMissing = (e: any) => { + // Suppress warnings for missing sprite images from base style + // This prevents console noise from OpenFreeMap's missing icons + if (!mapRef.current) return; + const map = mapRef.current.getMap(); + if (!map || map.hasImage(e.id)) return; + + // Add a transparent 1x1 placeholder to prevent repeated warnings + map.addImage(e.id, { + width: 1, + height: 1, + data: new Uint8Array(4), + }); + }; + if (mapRef.current) { const map = mapRef.current.getMap(); if (map) { map.on("moveend", handleMapChange); + map.on("styleimagemissing", handleStyleImageMissing); } } @@ -108,6 +123,7 @@ export default function StopMap() { const map = mapRef.current.getMap(); if (map) { map.off("moveend", handleMapChange); + map.off("styleimagemissing", handleStyleImageMissing); } } }; @@ -168,7 +184,7 @@ export default function StopMap() { layout={{ "icon-image": [ "case", - ["boolean", ["get", "cancelled"], false], + ["coalesce", ["get", "cancelled"], false], `stop-${region}-cancelled`, `stop-${region}`, ], diff --git a/src/frontend/app/routes/stops-$id.css b/src/frontend/app/routes/stops-$id.css index 7df3af2..c515435 100644 --- a/src/frontend/app/routes/stops-$id.css +++ b/src/frontend/app/routes/stops-$id.css @@ -1,5 +1,6 @@ .page-title { margin-block: 0; + font-size: 1.5rem; } .estimates-content-wrapper { @@ -269,7 +270,7 @@ background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 8px; - padding: 1rem; + padding: 0.5rem 1rem; color: #856404; flex-shrink: 0; } diff --git a/src/frontend/app/routes/stops-$id.tsx b/src/frontend/app/routes/stops-$id.tsx index ac41250..372582b 100644 --- a/src/frontend/app/routes/stops-$id.tsx +++ b/src/frontend/app/routes/stops-$id.tsx @@ -191,14 +191,19 @@ export default function Estimates() { <> <div className="page-container stops-page"> <div className="stops-header"> + <div> + <Star + className={`star-icon ${favourited ? "active" : ""}`} + onClick={toggleFavourite} + width={20} + /> + <Edit2 + className="edit-icon" + onClick={handleRename} + width={20} /> + </div> <h1 className="page-title"> - <Star - className={`star-icon ${favourited ? "active" : ""}`} - onClick={toggleFavourite} - /> - <Edit2 className="edit-icon" onClick={handleRename} /> - {getStopDisplayName()}{" "} - <span className="estimates-stop-id">({stopIdNum})</span> + {getStopDisplayName()} </h1> <button |
