feat(SW-750): add HotelLocation type
This commit is contained in:
@@ -34,6 +34,7 @@
|
|||||||
.socialIcons {
|
.socialIcons {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: var(--Spacing-x1);
|
gap: var(--Spacing-x1);
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.email {
|
.email {
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
2
components/ContentType/HotelPage/SidePeeks/index.ts
Normal file
2
components/ContentType/HotelPage/SidePeeks/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export { default as AboutTheHotelSidePeek } from "./AboutTheHotel"
|
||||||
|
export { default as WellnessAndExerciseSidePeek } from "./WellnessAndExercise"
|
||||||
@@ -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}
|
||||||
|
|||||||
@@ -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"]
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user