From 06e63ede6c4c3e229b1c76b9752ab03a1b7a9918 Mon Sep 17 00:00:00 2001 From: Florian Sommariva Date: Mon, 18 Sep 2023 16:00:09 +0200 Subject: [PATCH] Display viewPoints POIs in outdoor site detail page --- .../src/components/pages/site/OutdoorSiteUI.tsx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/pages/site/OutdoorSiteUI.tsx b/frontend/src/components/pages/site/OutdoorSiteUI.tsx index 2ca7b493e..322747b37 100644 --- a/frontend/src/components/pages/site/OutdoorSiteUI.tsx +++ b/frontend/src/components/pages/site/OutdoorSiteUI.tsx @@ -241,6 +241,14 @@ const OutdoorSiteUIWithoutContext: React.FC = ({ outdoorSiteUrl, language iconName: poi.type.label, }))} type="POI" + medias={{ + viewPoints: { + data: outdoorSiteContent.pois.flatMap( + ({ viewPoints }) => viewPoints, + ), + handleViewPointClick, + }, + }} /> ); @@ -593,7 +601,12 @@ const OutdoorSiteUIWithoutContext: React.FC = ({ outdoorSiteUrl, language }))} infrastructure={outdoorSiteContent.infrastructure} hideMap={hideMobileMap} - viewPoints={outdoorSiteContent.viewPoints} + viewPoints={[ + ...outdoorSiteContent.viewPoints, + ...outdoorSiteContent.pois + .flatMap(({ viewPoints }) => viewPoints) + .filter(Boolean), + ]} displayMap={displayMobileMap} setMapId={setMapId} />