fix(SW-188): replace formatMessage destructuring in hotel related components

This commit is contained in:
Chuma McPhoy
2024-08-14 21:01:56 +02:00
parent 96d3f68ad3
commit 2407f40b75
4 changed files with 39 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ export function RoomCard({
subtitle, subtitle,
title, title,
}: RoomCardProps) { }: RoomCardProps) {
const { formatMessage } = useIntl() const intl = useIntl()
const mainImage = images[0] const mainImage = images[0]
function handleImageClick() { function handleImageClick() {
@@ -37,7 +37,7 @@ export function RoomCard({
<button className={styles.imageWrapper} onClick={handleImageClick}> <button className={styles.imageWrapper} onClick={handleImageClick}>
{badgeTextTransKey && ( {badgeTextTransKey && (
<span className={styles.badge}> <span className={styles.badge}>
{formatMessage({ id: badgeTextTransKey })} {intl.formatMessage({ id: badgeTextTransKey })}
</span> </span>
)} )}
<span className={styles.imageCount}> <span className={styles.imageCount}>
@@ -67,7 +67,9 @@ export function RoomCard({
variant="underscored" variant="underscored"
onClick={handleRoomCtaClick} onClick={handleRoomCtaClick}
> >
{formatMessage({ id: "hotelPages.rooms.roomCard.seeRoomDetails" })} {intl.formatMessage({
id: "hotelPages.rooms.roomCard.seeRoomDetails",
})}
</Link> </Link>
</div> </div>
</article> </article>

View File

@@ -10,7 +10,7 @@ import { HotelHashValues } from "@/types/components/hotelPage/tabNavigation"
export default function TabNavigation() { export default function TabNavigation() {
const hash = useHash() const hash = useHash()
const { formatMessage } = useIntl() const intl = useIntl()
const hotelTabLinks: { href: HotelHashValues; text: string }[] = [ const hotelTabLinks: { href: HotelHashValues; text: string }[] = [
{ href: HotelHashValues.overview, text: "Overview" }, { href: HotelHashValues.overview, text: "Overview" },
{ href: HotelHashValues.rooms, text: "Rooms" }, { href: HotelHashValues.rooms, text: "Rooms" },
@@ -35,7 +35,7 @@ export default function TabNavigation() {
color="burgundy" color="burgundy"
textDecoration="none" textDecoration="none"
> >
{formatMessage({ id: link.text })} {intl.formatMessage({ id: link.text })}
</Link> </Link>
) )
})} })}

View File

@@ -1,4 +1,4 @@
import * as api from "@/lib/api" // import * as api from "@/lib/api"
import { badRequestError } from "@/server/errors/trpc" import { badRequestError } from "@/server/errors/trpc"
import { publicProcedure, router, serviceProcedure } from "@/server/trpc" import { publicProcedure, router, serviceProcedure } from "@/server/trpc"
import { toApiLang } from "@/server/utils" import { toApiLang } from "@/server/utils"

View File

@@ -7,6 +7,37 @@
"isPublished": true, "isPublished": true,
"cityId": "8ec4bba3-1c38-4606-82d1-bbe3f6738e54", "cityId": "8ec4bba3-1c38-4606-82d1-bbe3f6738e54",
"cityName": "Stockholm", "cityName": "Stockholm",
"ratings": {
"tripAdvisor": {
"numberOfReviews": 2776,
"rating": 4.0,
"ratingImageUrl": "https://www.tripadvisor.com/img/cdsi/img2/ratings/traveler/4.5-15458-5.svg",
"webUrl": "https://www.tripadvisor.com/Hotel_Review-g189852-d229383-Reviews-Scandic_Continental-Stockholm.html",
"awards": [
{
"displayName": "Travelers Choice",
"images": {
"small": "https://static.tacdn.com/img2/travelers_choice/widgets/tchotel_2024_L.png",
"medium": "https://static.tacdn.com/img2/travelers_choice/widgets/tchotel_2024_L.png",
"large": "https://static.tacdn.com/img2/travelers_choice/widgets/tchotel_2024_L.png"
}
},
{
"displayName": "Travelers Choice",
"images": {
"small": "https://static.tacdn.com/img2/travelers_choice/widgets/tchotel_2023_L.png",
"medium": "https://static.tacdn.com/img2/travelers_choice/widgets/tchotel_2023_L.png",
"large": "https://static.tacdn.com/img2/travelers_choice/widgets/tchotel_2023_L.png"
}
}
],
"reviews": {
"widgetHtmlTagId": "TA_cdspropertydetail",
"widgetScriptEmbedUrlIframe": "//www.tripadvisor.com/WidgetEmbed-cdspropertydetail?locationId=12441627&partnerId=FDF3F5CC73C349C0A5AB94C0DD86BB76&lang=en&display=true",
"widgetScriptEmbedUrlJavaScript": "//www.tripadvisor.com/WidgetEmbed-cdspropertydetail?locationId=12441627&partnerId=FDF3F5CC73C349C0A5AB94C0DD86BB76&lang=en&display=false"
}
}
},
"address": { "address": {
"streetAddress": "Vasagatan 22", "streetAddress": "Vasagatan 22",
"city": "Stockholm", "city": "Stockholm",