feat(SW-344) Correct position of pins in mobile

This commit is contained in:
Pontus Dreij
2024-11-12 14:33:37 +01:00
parent 96a5277881
commit 87b999676b
13 changed files with 106 additions and 68 deletions

View File

@@ -70,6 +70,10 @@
justify-content: center;
}
.address {
display: none;
}
@media screen and (min-width: 1367px) {
.card.pageListing {
grid-template-areas:
@@ -118,4 +122,12 @@
.pageListing .button {
width: 160px;
}
.address {
display: block;
}
.addressMobile {
display: none;
}
}

View File

@@ -1,6 +1,9 @@
"use client"
import { useParams } from "next/dist/client/components/navigation"
import { useIntl } from "react-intl"
import { selectHotelMap } from "@/constants/routes/hotelReservation"
import { mapFacilityToIcon } from "@/components/ContentType/HotelPage/data"
import { PriceTagIcon, ScandicLogoIcon } from "@/components/Icons"
import TripAdvisorIcon from "@/components/Icons/TripAdvisor"
@@ -26,6 +29,7 @@ export default function HotelCard({
state = "default",
onHotelCardHover,
}: HotelCardProps) {
const params = useParams()
const intl = useIntl()
const { hotelData } = hotel
@@ -77,9 +81,19 @@ export default function HotelCard({
<Title as="h4" textTransform="capitalize">
{hotelData.name}
</Title>
<Footnote color="uiTextMediumContrast">
<Footnote color="uiTextMediumContrast" className={styles.address}>
{`${hotelData.address.streetAddress}, ${hotelData.address.city}`}
</Footnote>
<Link
className={styles.addressMobile}
href={`${selectHotelMap[params.lang as keyof typeof selectHotelMap]}?selectedHotel=${hotelData.name}`}
keepSearchParams
variant="underscored"
>
<Footnote color="burgundy">
{`${hotelData.address.streetAddress}, ${hotelData.address.city}`}
</Footnote>
</Link>
<Footnote color="uiTextMediumContrast">
{`${hotelData.location.distanceToCentre} ${intl.formatMessage({ id: "km to city center" })}`}
</Footnote>