feat(SW-750): add base url

This commit is contained in:
Fredrik Thorsson
2024-11-18 15:30:25 +01:00
parent 32bd5b8b6f
commit acd1656885
3 changed files with 12 additions and 5 deletions

View File

@@ -10,7 +10,10 @@ import { getLang } from "@/i18n/serverContext"
import styles from "./contactInformation.module.css"
import type { ContactInformationProps } from "@/types/components/hotelPage/sidepeek/contactInformation"
import {
type ContactInformationProps,
GoogleMapsDirections,
} from "@/types/components/hotelPage/sidepeek/contactInformation"
export default async function ContactInformation({
hotelAdress,
@@ -41,7 +44,7 @@ export default async function ContactInformation({
{intl.formatMessage({ id: "Driving directions" })}
</Body>
<Link
href={`https://www.google.com/maps/dir/?api=1&destination=${coordinates.lat},${coordinates.lng}`}
href={`${GoogleMapsDirections.BASE_URL}${coordinates.lat},${coordinates.lng}`}
target="_blank"
color="peach80"
textDecoration="underline"
@@ -92,7 +95,7 @@ export default async function ContactInformation({
{contact.email}
</Link>
</div>
{ecoLabels.nordicEcoLabel ? (
{ecoLabels.nordicEcoLabel && (
<div className={styles.ecoLabel}>
<Image
height={38}
@@ -109,7 +112,7 @@ export default async function ContactInformation({
</Caption>
</div>
</div>
) : null}
)}
</div>
</div>
)

View File

@@ -16,7 +16,7 @@ export default async function Facility({ data }: FacilityProps) {
return (
<div className={styles.content}>
{image.imageSizes.medium && (
{image?.imageSizes.medium && (
<Image
src={image.imageSizes.medium}
alt={image.metaData.altText || ""}

View File

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