From 5298fb9f605123155b7a3fbdbca4396cdf4c5aaa Mon Sep 17 00:00:00 2001 From: fisenko Date: Thu, 6 Nov 2025 00:32:19 +0300 Subject: [PATCH] feat: Add `description` for stations in sightbar --- src/pages/MapPage/index.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/pages/MapPage/index.tsx b/src/pages/MapPage/index.tsx index 6ada42b..db3732b 100644 --- a/src/pages/MapPage/index.tsx +++ b/src/pages/MapPage/index.tsx @@ -139,6 +139,7 @@ interface ApiRoute { interface ApiStation { id: number; name: string; + description?: string; latitude: number; longitude: number; city_id: number; @@ -2375,6 +2376,7 @@ const MapSightbar: React.FC = observer( ) ), name: station.name, + description: station.description || "", }); feature.setId(`station-${station.id}`); feature.set("featureType", "station"); @@ -2813,11 +2815,19 @@ const MapSightbar: React.FC = observer( numericRouteId !== null && mapStore.hiddenRoutes.has(numericRouteId); + const description = feature.get("description") as + | string + | undefined; + const showDescription = + featureType === "station" && + description && + description.trim() !== ""; + return (
= observer( {fName}
+ {showDescription && ( +
+ {description} +
+ )}