feat(SW-1012): add translations

This commit is contained in:
Fredrik Thorsson
2024-12-10 15:20:22 +01:00
parent 9f3c5f6040
commit c47523df96
9 changed files with 42 additions and 17 deletions

View File

@@ -19,9 +19,7 @@ export default function OpeningHours({
return (
<div>
<Body textTransform="bold" asChild>
<h5>{openingHours.name}</h5>
</Body>
<Body textTransform="bold">{openingHours.name}</Body>
{days.map((day) => {
const today = openingHours[day] as RestaurantOpeningHoursDay
return today ? (

View File

@@ -1,33 +1,34 @@
import NextLink from "next/link"
import { OpenInNewSmallIcon } from "@/components/Icons"
import Image from "@/components/Image"
import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n"
import OpeningHours from "../OpeningHours"
import styles from "./restaurantBarItem.module.css"
import { RestaurantBarItemProps } from "@/types/components/hotelPage/sidepeek/restaurantBar"
import type { RestaurantBarItemProps } from "@/types/components/hotelPage/sidepeek/restaurantBar"
export default function RestaurantBarItem({
export default async function RestaurantBarItem({
restaurant,
}: RestaurantBarItemProps) {
const intl = await getIntl()
const { name, openingDetails, menus } = restaurant
const { images, bookTableUrl } = restaurant.content
const visibleImages = restaurant.content.images.slice(0, 2)
const imageWidth = images.length === 2 ? 240 : 496
// TODO: Not defined where this should lead.
const ctaUrl = ""
console.log({ bookTableUrl: bookTableUrl })
return (
<div className={styles.restaurantBarItem}>
<div className={styles.stickyHeading}>
<Subtitle type="one" color="burgundy" asChild>
<h3>{name}</h3>
<Title level="h3">{name}</Title>
</Subtitle>
</div>
<div className={styles.imageWrapper}>
@@ -45,7 +46,9 @@ export default function RestaurantBarItem({
{openingDetails.length ? (
<div className={styles.content}>
<Subtitle type="two" asChild>
<h4>Opening Hours</h4>
<Title level="h4">
{intl.formatMessage({ id: "Opening Hours" })}
</Title>
</Subtitle>
{openingDetails.map((details) => (
<OpeningHours
@@ -59,7 +62,7 @@ export default function RestaurantBarItem({
{menus.length ? (
<div className={styles.content}>
<Subtitle type="two" asChild>
<h4>Menus</h4>
<Title level="h4">{intl.formatMessage({ id: "Menus" })}</Title>
</Subtitle>
<ul className={styles.menuList}>
{menus.map(({ name, url }) => (
@@ -70,7 +73,6 @@ export default function RestaurantBarItem({
textDecoration="underline"
variant="icon"
color="baseTextMediumContrast"
className={styles.menuLink}
>
{name}
<OpenInNewSmallIcon />
@@ -84,14 +86,21 @@ export default function RestaurantBarItem({
<div className={styles.ctaWrapper}>
{bookTableUrl ? (
<Button fullWidth theme="base" intent="primary" asChild>
<a href={bookTableUrl} target="_blank">
Book a table online
</a>
<Link
href={bookTableUrl}
color="white"
weight="bold"
target="_blank"
>
{intl.formatMessage({ id: "Book a table online" })}
</Link>
</Button>
) : null}
{ctaUrl ? (
<Button fullWidth theme="base" intent="secondary" asChild>
<NextLink href={ctaUrl}>Discover {name}</NextLink>
<Link href={ctaUrl} color="burgundy" weight="bold">
{`${intl.formatMessage({ id: "Discover" })} ${name}`} {name}
</Link>
</Button>
) : null}
</div>

View File

@@ -13,8 +13,8 @@ import type { RestaurantBarSidePeekProps } from "@/types/components/hotelPage/si
export default async function RestaurantBarSidePeek({
restaurants,
}: RestaurantBarSidePeekProps) {
const lang = getLang()
const intl = await getIntl()
const lang = getLang()
return (
<SidePeek