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

View File

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