diff --git a/components/ContentType/DestinationOverviewPage/OverviewMapContainer/InputForm/index.tsx b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/InputForm/index.tsx new file mode 100644 index 000000000..f91466b9f --- /dev/null +++ b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/InputForm/index.tsx @@ -0,0 +1,19 @@ +"use client" +import { useIntl } from "react-intl" + +import styles from "./inputFrom.module.css" + +export default function InputForm() { + const intl = useIntl() + return ( +
+ +
+ ) +} diff --git a/components/ContentType/DestinationOverviewPage/OverviewMapContainer/InputForm/inputFrom.module.css b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/InputForm/inputFrom.module.css new file mode 100644 index 000000000..08a74aa86 --- /dev/null +++ b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/InputForm/inputFrom.module.css @@ -0,0 +1,14 @@ +.form { + position: absolute; + top: 25px; + left: 50%; + transform: translateX(-50%); + z-index: 1; + background-color: var(--Base-Background-Primary-Normal); +} + +.formInput { + padding: var(--Spacing-x-one-and-half); + border: none; + width: 250px; +} diff --git a/components/ContentType/DestinationOverviewPage/OverviewMapContainer/OverviewMap/index.tsx b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/OverviewMap/index.tsx new file mode 100644 index 000000000..2e0684967 --- /dev/null +++ b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/OverviewMap/index.tsx @@ -0,0 +1,62 @@ +"use client" +import { Map, type MapProps, useMap } from "@vis.gl/react-google-maps" +import { useIntl } from "react-intl" + +import { MinusIcon, PlusIcon } from "@/components/Icons" +import Button from "@/components/TempDesignSystem/Button" + +import styles from "./overviewMap.module.css" + +import type { OverviewMapProps } from "@/types/components/destinationOverviewPage/overviewMap/overviewMap" + +export default function OverviewMap({ mapId }: OverviewMapProps) { + const map = useMap() + const intl = useIntl() + + // Placeholder value, currently these coordinates are Stockholm + const defaultCenter = { + lat: 59.3293, + lng: 18.0686, + } + + const mapOptions: MapProps = { + defaultZoom: 4, + minZoom: 3, + defaultCenter: defaultCenter, + disableDefaultUI: true, + clickableIcons: false, + mapId: mapId, + } + + function zoomIn() { + const currentZoom = map && map.getZoom() + if (currentZoom) { + map.setZoom(currentZoom + 1) + } + } + + function zoomOut() { + const currentZoom = map && map.getZoom() + if (currentZoom) { + map.setZoom(currentZoom - 1) + } + } + + const zoomControls = ( +
+ + +
+ ) + + return ( +
+ + {zoomControls} +
+ ) +} diff --git a/components/ContentType/DestinationOverviewPage/OverviewMapContainer/OverviewMap/overviewMap.module.css b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/OverviewMap/overviewMap.module.css new file mode 100644 index 000000000..f87814dd1 --- /dev/null +++ b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/OverviewMap/overviewMap.module.css @@ -0,0 +1,13 @@ +.mapContainer { + position: relative; + min-width: var(--max-width-page); + min-height: 700px; /* Placeholder value */ +} + +.buttonContainer { + position: absolute; + display: flex; + gap: var(--Spacing-x1); + right: 25px; + bottom: 25px; +} diff --git a/components/ContentType/DestinationOverviewPage/OverviewMapContainer/index.tsx b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/index.tsx new file mode 100644 index 000000000..c546c8363 --- /dev/null +++ b/components/ContentType/DestinationOverviewPage/OverviewMapContainer/index.tsx @@ -0,0 +1,19 @@ +"use client" +import { APIProvider } from "@vis.gl/react-google-maps" + +import InputForm from "./InputForm" +import OverviewMap from "./OverviewMap" + +import type { OverviewMapContainerProps } from "@/types/components/destinationOverviewPage/overviewMap/overviewMapContainer" + +export default function OverviewMapContainer({ + apiKey, + mapId, +}: OverviewMapContainerProps) { + return ( + + + + + ) +} diff --git a/components/ContentType/DestinationOverviewPage/destinationOverviewPage.module.css b/components/ContentType/DestinationOverviewPage/destinationOverviewPage.module.css index c58807d98..6fb0b4091 100644 --- a/components/ContentType/DestinationOverviewPage/destinationOverviewPage.module.css +++ b/components/ContentType/DestinationOverviewPage/destinationOverviewPage.module.css @@ -1,4 +1,5 @@ .pageContainer { + position: relative; display: grid; max-width: var(--max-width); } diff --git a/components/ContentType/DestinationOverviewPage/index.tsx b/components/ContentType/DestinationOverviewPage/index.tsx index db5406452..689190397 100644 --- a/components/ContentType/DestinationOverviewPage/index.tsx +++ b/components/ContentType/DestinationOverviewPage/index.tsx @@ -1,9 +1,12 @@ import { Suspense } from "react" +import { env } from "@/env/server" import { getDestinationOverviewPage } from "@/lib/trpc/memoizedRequests" import TrackingSDK from "@/components/TrackingSDK" +import OverviewMapContainer from "./OverviewMapContainer" + import styles from "./destinationOverviewPage.module.css" export default async function DestinationOverviewPage() { @@ -15,9 +18,15 @@ export default async function DestinationOverviewPage() { const { tracking, destinationOverviewPage } = pageData + const googleMapsApiKey = env.GOOGLE_STATIC_MAP_KEY + const googleMapId = env.GOOGLE_DYNAMIC_MAP_ID + return ( <>
+ {googleMapsApiKey ? ( + + ) : null}

Destination Overview Page

diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 76bed1c9f..b75535fb9 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -164,6 +164,7 @@ "Filter by": "Filtrer efter", "Find booking": "Find booking", "Find hotels": "Find hotel", + "Find hotels and destinations": "Find hoteller og destinationer", "First name": "Fornavn", "First name can't contain any special characters": "Fornavn kan ikke indeholde specielle tegn", "First name is required": "Fornavn er påkrævet", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index cb314dccb..07b923fd9 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -163,6 +163,7 @@ "Filter by": "Filtern nach", "Find booking": "Buchung finden", "Find hotels": "Hotels finden", + "Find hotels and destinations": "Finden Sie Hotels und Reiseziele", "First name": "Vorname", "First name can't contain any special characters": "Der Vorname darf keine Sonderzeichen enthalten", "First name is required": "Vorname ist erforderlich", diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index c9993f4b4..4c86388aa 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -175,6 +175,7 @@ "Filter by": "Filter by", "Find booking": "Find booking", "Find hotels": "Find hotels", + "Find hotels and destinations": "Find hotels and destinations", "First name": "First name", "First name can't contain any special characters": "First name can't contain any special characters", "First name is required": "First name is required", diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index 7e332f0fd..cd21f5ec0 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -164,6 +164,7 @@ "Filter by": "Suodatusperuste", "Find booking": "Etsi varaus", "Find hotels": "Etsi hotelleja", + "Find hotels and destinations": "Etsi hotelleja ja kohteita", "First name": "Etunimi", "First name can't contain any special characters": "Etunimi ei voi sisältää erikoismerkkejä", "First name is required": "Etunimi vaaditaan", diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index c68254dce..51388333b 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -163,6 +163,7 @@ "Filter by": "Filtrer etter", "Find booking": "Finn booking", "Find hotels": "Finn hotell", + "Find hotels and destinations": "Finn hoteller og destinasjoner", "First name": "Fornavn", "First name can't contain any special characters": "Fornavn kan ikke inneholde spesielle tegn", "First name is required": "Fornavn kreves", diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index 5467558cc..54383d2c6 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -163,6 +163,7 @@ "Filter by": "Filtrera på", "Find booking": "Hitta bokning", "Find hotels": "Hitta hotell", + "Find hotels and destinations": "Hitta hotell och destinationer", "First name": "Förnamn", "First name can't contain any special characters": "Förnamn får inte innehålla några specialtecken", "First name is required": "Förnamn är obligatoriskt", diff --git a/types/components/destinationOverviewPage/overviewMap/overviewMap.ts b/types/components/destinationOverviewPage/overviewMap/overviewMap.ts new file mode 100644 index 000000000..c34da144b --- /dev/null +++ b/types/components/destinationOverviewPage/overviewMap/overviewMap.ts @@ -0,0 +1,3 @@ +export type OverviewMapProps = { + mapId: string +} diff --git a/types/components/destinationOverviewPage/overviewMap/overviewMapContainer.ts b/types/components/destinationOverviewPage/overviewMap/overviewMapContainer.ts new file mode 100644 index 000000000..1cae02223 --- /dev/null +++ b/types/components/destinationOverviewPage/overviewMap/overviewMapContainer.ts @@ -0,0 +1,4 @@ +export type OverviewMapContainerProps = { + apiKey: string + mapId: string +}