diff --git a/.env.local.example b/.env.local.example index 871ea42fe..952e8161f 100644 --- a/.env.local.example +++ b/.env.local.example @@ -42,3 +42,5 @@ OPENSSL_MODULES="/var/lang/lib/ossl-modules" PUBLIC_URL="http://localhost:3000" AUTH_URL="$PUBLIC_URL/api/web/auth" NEXTAUTH_URL="$PUBLIC_URL/api/web/auth" + +NEXT_PUBLIC_GOOGLE_STATIC_MAP_KEY="" diff --git a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.module.css b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.module.css index e8b0334b5..31faba044 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.module.css +++ b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.module.css @@ -1,12 +1,23 @@ .main { display: grid; - grid-template-columns: repeat(3, minmax(min-content, max-content)); + grid-template-columns: repeat(2, minmax(min-content, max-content)); + gap: var(--Spacing-x4); padding: var(--Spacing-x4) var(--Spacing-x4) 0 var(--Spacing-x4); height: 100dvh; background-color: var(--Scandic-Brand-Warm-White); } +.button { + padding-left: var(--Spacing-x0); +} + .section { display: grid; gap: var(--Spacing-x4); } + +.link { + display: flex; + align-items: center; + padding: var(--Spacing-x2) var(--Spacing-x0); +} diff --git a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx index e34e008cf..de7e8be68 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/select-hotel/page.tsx @@ -2,6 +2,10 @@ import { serverClient } from "@/lib/trpc/server" import HotelCard from "@/components/HotelReservation/HotelCard" import HotelFilter from "@/components/HotelReservation/SelectHotel/HotelFilter" +import { ChevronRightIcon } from "@/components/Icons" +import StaticMap from "@/components/Maps/StaticMap" +import Link from "@/components/TempDesignSystem/Link" +import { getIntl } from "@/i18n" import styles from "./page.module.css" @@ -10,6 +14,8 @@ import { LangParams, PageArgs } from "@/types/params" export default async function SelectHotelPage({ params, }: PageArgs) { + const { formatMessage } = await getIntl() + const { attributes } = await serverClient().hotel.getHotel({ hotelId: "d98c7ab1-ebaa-4102-b351-758daf1ddf55", language: params.lang, @@ -20,14 +26,36 @@ export default async function SelectHotelPage({ hotelId: "d98c7ab1-ebaa-4102-b351-758daf1ddf55", }) + const tempSearchTerm = "Stockholm" + return ( -
- -
- {hotels.map((hotel) => ( - - ))} -
-
+ <> +
+ +
+ {hotels.map((hotel) => ( + + ))} +
+
+ ) } diff --git a/components/HotelReservation/HotelCard/hotelCard.module.css b/components/HotelReservation/HotelCard/hotelCard.module.css index 7e3256a7c..c1245bc6a 100644 --- a/components/HotelReservation/HotelCard/hotelCard.module.css +++ b/components/HotelReservation/HotelCard/hotelCard.module.css @@ -3,6 +3,7 @@ background-color: var(--Base-Surface-Primary-light-Normal); border: 1px solid var(--Base-Border-Subtle); border-radius: var(--Corner-radius-Small); + overflow: hidden; height: 460px; width: 480px; } @@ -11,7 +12,7 @@ height: auto; max-height: 180px; object-fit: cover; - overflow: hidden; + width: 100%; } diff --git a/components/Maps/StaticMap/index.tsx b/components/Maps/StaticMap/index.tsx new file mode 100644 index 000000000..8d481858d --- /dev/null +++ b/components/Maps/StaticMap/index.tsx @@ -0,0 +1,24 @@ +import Image from "@/components/Image" + +import { StaticMapProps } from "@/types/components/maps/staticMap/staticMap" + +export default function StaticMap({ + city, + width, + height, + zoomLevel, + mapType, +}: StaticMapProps) { + const apiKey = process.env.NEXT_PUBLIC_GOOGLE_STATIC_MAP_KEY + const mapUrl = `https://maps.googleapis.com/maps/api/staticmap?center=${city}&zoom=${zoomLevel}&size=${width}x${height}&maptype=${mapType}&key=${apiKey}` + + return ( + {`Map + ) +} diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 77f96b5de..dbddcc2d3 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -126,5 +126,6 @@ "Zip code": "Postnummer", "Room facilities": "Værelsesfaciliteter", "Hotel facilities": "Hotel faciliteter", - "Hotel surroundings": "Hotel omgivelser" + "Hotel surroundings": "Hotel omgivelser", + "Show map": "Vis kort" } diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 5f9c4e996..2e2edd90b 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -126,5 +126,6 @@ "Zip code": "PLZ", "Room facilities": "Zimmerausstattung", "Hotel facilities": "Hotel-Infos", - "Hotel surroundings": "Umgebung des Hotels" + "Hotel surroundings": "Umgebung des Hotels", + "Show map": "Karte anzeigen" } diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index b2f0d47eb..9d17d8126 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -131,5 +131,6 @@ "Zip code": "Zip code", "Room facilities": "Room facilities", "Hotel facilities": "Hotel facilities", - "Hotel surroundings": "Hotel surroundings" + "Hotel surroundings": "Hotel surroundings", + "Show map": "Show map" } diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index d991b7630..fe958b486 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -126,5 +126,6 @@ "Zip code": "Postinumero", "Room facilities": "Huoneen varustelu", "Hotel facilities": "Hotellin palvelut", - "Hotel surroundings": "Hotellin ympäristö" + "Hotel surroundings": "Hotellin ympäristö", + "Show map": "Näytä kartta" } diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index 2f0cb8e3e..9081240df 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -126,5 +126,6 @@ "Zip code": "Post kode", "Room facilities": "Romfasiliteter", "Hotel facilities": "Hotelfaciliteter", - "Hotel surroundings": "Hotellomgivelser" + "Hotel surroundings": "Hotellomgivelser", + "Show map": "Vis kart" } diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index a5bb53782..ce749c94f 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -129,5 +129,6 @@ "Zip code": "Postnummer", "Room facilities": "Rumlfaciliteter", "Hotel facilities": "Hotellfaciliteter", - "Hotel surroundings": "Hotellomgivning" + "Hotel surroundings": "Hotellomgivning", + "Show map": "Visa karta" } diff --git a/next.config.js b/next.config.js index 60e5a38d9..037649b65 100644 --- a/next.config.js +++ b/next.config.js @@ -41,6 +41,11 @@ const nextConfig = { protocol: "https", hostname: "imagevault.scandichotels.com", }, + { + protocol: "https", + hostname: "maps.googleapis.com", + pathname: "/maps/api/staticmap?**", + }, ], }, diff --git a/types/components/maps/staticMap/staticMap.ts b/types/components/maps/staticMap/staticMap.ts new file mode 100644 index 000000000..e2e058b83 --- /dev/null +++ b/types/components/maps/staticMap/staticMap.ts @@ -0,0 +1,7 @@ +export type StaticMapProps = { + city: string + width: number + height: number + zoomLevel: number + mapType: "roadmap" | "satellite" | "terrain" | "hybrid" +}