feat(SW-750): add HotelLocation type

This commit is contained in:
Fredrik Thorsson
2024-11-20 13:19:59 +01:00
parent 1881f6646d
commit b8767dd8f1
6 changed files with 12 additions and 17 deletions

View File

@@ -34,6 +34,7 @@
.socialIcons { .socialIcons {
display: flex; display: flex;
gap: var(--Spacing-x1); gap: var(--Spacing-x1);
align-items: center;
} }
.email { .email {

View File

@@ -10,10 +10,7 @@ import { getLang } from "@/i18n/serverContext"
import styles from "./contactInformation.module.css" import styles from "./contactInformation.module.css"
import { import type { ContactInformationProps } from "@/types/components/hotelPage/sidepeek/contactInformation"
type ContactInformationProps,
GoogleMapsDirections,
} from "@/types/components/hotelPage/sidepeek/contactInformation"
export default async function ContactInformation({ export default async function ContactInformation({
hotelAddress, hotelAddress,
@@ -24,6 +21,9 @@ export default async function ContactInformation({
}: ContactInformationProps) { }: ContactInformationProps) {
const intl = await getIntl() const intl = await getIntl()
const lang = getLang() const lang = getLang()
const { latitude, longitude } = coordinates
const directionsUrl = `https://www.google.com/maps/dir/?api=1&destination=${latitude},${longitude}`
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<Subtitle color="burgundy" asChild> <Subtitle color="burgundy" asChild>
@@ -44,7 +44,7 @@ export default async function ContactInformation({
{intl.formatMessage({ id: "Driving directions" })} {intl.formatMessage({ id: "Driving directions" })}
</Body> </Body>
<Link <Link
href={`${GoogleMapsDirections.BASE_URL}${coordinates.lat},${coordinates.lng}`} href={directionsUrl}
target="_blank" target="_blank"
color="peach80" color="peach80"
textDecoration="underline" textDecoration="underline"

View File

@@ -0,0 +1,2 @@
export { default as AboutTheHotelSidePeek } from "./AboutTheHotel"
export { default as WellnessAndExerciseSidePeek } from "./WellnessAndExercise"

View File

@@ -16,13 +16,12 @@ import MapCard from "./Map/MapCard"
import MapWithCardWrapper from "./Map/MapWithCard" import MapWithCardWrapper from "./Map/MapWithCard"
import MobileMapToggle from "./Map/MobileMapToggle" import MobileMapToggle from "./Map/MobileMapToggle"
import StaticMap from "./Map/StaticMap" import StaticMap from "./Map/StaticMap"
import AboutTheHotelSidePeek from "./SidePeeks/AboutTheHotel"
import WellnessAndExerciseSidePeek from "./SidePeeks/WellnessAndExercise"
import AmenitiesList from "./AmenitiesList" import AmenitiesList from "./AmenitiesList"
import Facilities from "./Facilities" import Facilities from "./Facilities"
import IntroSection from "./IntroSection" import IntroSection from "./IntroSection"
import PreviewImages from "./PreviewImages" import PreviewImages from "./PreviewImages"
import { Rooms } from "./Rooms" import { Rooms } from "./Rooms"
import { AboutTheHotelSidePeek, WellnessAndExerciseSidePeek } from "./SidePeeks"
import TabNavigation from "./TabNavigation" import TabNavigation from "./TabNavigation"
import styles from "./hotelPage.module.css" import styles from "./hotelPage.module.css"
@@ -140,7 +139,7 @@ export default async function HotelPage() {
</SidePeek> </SidePeek>
<AboutTheHotelSidePeek <AboutTheHotelSidePeek
hotelAddress={hotelAddress} hotelAddress={hotelAddress}
coordinates={coordinates} coordinates={hotelLocation}
contact={contact} contact={contact}
socials={socials} socials={socials}
ecoLabels={ecoLabels} ecoLabels={ecoLabels}

View File

@@ -1,11 +1,8 @@
import type { Hotel, HotelAddress } from "@/types/hotel" import type { Hotel, HotelAddress, HotelLocation } from "@/types/hotel"
export type AboutTheHotelSidePeekProps = { export type AboutTheHotelSidePeekProps = {
hotelAddress: HotelAddress hotelAddress: HotelAddress
coordinates: { coordinates: HotelLocation
lat: number
lng: number
}
contact: Hotel["contactInformation"] contact: Hotel["contactInformation"]
socials: Hotel["socialMedia"] socials: Hotel["socialMedia"]
ecoLabels: Hotel["hotelFacts"]["ecoLabels"] ecoLabels: Hotel["hotelFacts"]["ecoLabels"]

View File

@@ -1,9 +1,5 @@
import type { AboutTheHotelSidePeekProps } from "./aboutTheHotel" import type { AboutTheHotelSidePeekProps } from "./aboutTheHotel"
export enum GoogleMapsDirections {
BASE_URL = "https://www.google.com/maps/dir/?api=1&destination=",
}
export type ContactInformationProps = Omit< export type ContactInformationProps = Omit<
AboutTheHotelSidePeekProps, AboutTheHotelSidePeekProps,
"descriptions" "descriptions"