From 8714bc79fd43b6dcb93ad44d2de012f094987466 Mon Sep 17 00:00:00 2001 From: Erik Tiekstra Date: Thu, 23 Oct 2025 13:06:45 +0000 Subject: [PATCH] feat(BOOK-116): Added better alt text to static map on hotel pages Approved-by: Bianca Widstam --- .../HotelPage/Map/StaticMap/index.tsx | 21 +++++++++++++++---- .../ContentType/HotelPage/index.tsx | 1 + .../components/hotelPage/map/staticMap.ts | 10 --------- 3 files changed, 18 insertions(+), 14 deletions(-) delete mode 100644 apps/scandic-web/types/components/hotelPage/map/staticMap.ts diff --git a/apps/scandic-web/components/ContentType/HotelPage/Map/StaticMap/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/Map/StaticMap/index.tsx index 62960dfc1..d2dd452ba 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/Map/StaticMap/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/Map/StaticMap/index.tsx @@ -8,11 +8,23 @@ import { calculateLatWithOffset } from "@/utils/map" import styles from "./staticMap.module.css" -import type { StaticMapProps } from "@/types/components/hotelPage/map/staticMap" +import type { MarkerInfo } from "@scandic-hotels/design-system/Map/types" +import type { HotelAddress } from "@scandic-hotels/trpc/types/hotel" + +import type { Coordinates } from "@/types/components/maps/coordinates" + +type StaticMapProps = { + coordinates: Coordinates + hotelName: string + address: HotelAddress + zoomLevel?: number + markerInfo: MarkerInfo +} export default async function StaticMap({ coordinates, hotelName, + address, markerInfo, zoomLevel = 14, }: StaticMapProps) { @@ -25,6 +37,7 @@ export default async function StaticMap({ lat: calculateLatWithOffset(coordinates.lat, mapLatitudeInPx, zoomLevel), lng: coordinates.lng, } + const addressString = `${address.streetAddress}, ${address.city}` return (
@@ -35,10 +48,10 @@ export default async function StaticMap({ zoomLevel={zoomLevel} altText={intl.formatMessage( { - id: "hotel.staticMap.mapOfHotelName", - defaultMessage: "Map of {hotelName}", + id: "hotel.staticMap.mapOfHotelNameAndAddress", + defaultMessage: "Map of {hotelName}, {address}", }, - { hotelName } + { hotelName, address: addressString } )} mapId={mapId} /> diff --git a/apps/scandic-web/components/ContentType/HotelPage/index.tsx b/apps/scandic-web/components/ContentType/HotelPage/index.tsx index bfdc3c1d8..e88850170 100644 --- a/apps/scandic-web/components/ContentType/HotelPage/index.tsx +++ b/apps/scandic-web/components/ContentType/HotelPage/index.tsx @@ -236,6 +236,7 @@ export default async function HotelPage({ diff --git a/apps/scandic-web/types/components/hotelPage/map/staticMap.ts b/apps/scandic-web/types/components/hotelPage/map/staticMap.ts deleted file mode 100644 index 154464167..000000000 --- a/apps/scandic-web/types/components/hotelPage/map/staticMap.ts +++ /dev/null @@ -1,10 +0,0 @@ -import type { MarkerInfo } from "@scandic-hotels/design-system/Map/types" - -import type { Coordinates } from "../../maps/coordinates" - -export type StaticMapProps = { - coordinates: Coordinates - hotelName: string - zoomLevel?: number - markerInfo: MarkerInfo -}