Merged in feat/SW-1296-external-restaurant-page (pull request #1306)

Feat(SW-1296): External restaurant page

Approved-by: Erik Tiekstra
Approved-by: Fredrik Thorsson
This commit is contained in:
Matilda Landström
2025-02-11 14:55:32 +00:00
parent b394d54c3f
commit 72e8e7f1ab

View File

@@ -15,8 +15,15 @@ export default async function RestaurantBarItem({
restaurant, restaurant,
}: RestaurantBarItemProps) { }: RestaurantBarItemProps) {
const intl = await getIntl() const intl = await getIntl()
const { bookTableUrl, name, openingDetails, content, menus, restaurantPage } = const {
restaurant bookTableUrl,
name,
openingDetails,
content,
menus,
restaurantPage,
mainBody,
} = restaurant
const { images } = restaurant.content const { images } = restaurant.content
const visibleImages = restaurant.content.images.slice(0, 2) const visibleImages = restaurant.content.images.slice(0, 2)
const imageWidth = images.length === 2 ? 240 : 496 const imageWidth = images.length === 2 ? 240 : 496
@@ -80,6 +87,7 @@ export default async function RestaurantBarItem({
</ul> </ul>
</div> </div>
) : null} ) : null}
{/* If (restaurantPage && bookTableUrl && mainBody==empty), link to external restaurant page. */}
{bookTableUrl || restaurantPage ? ( {bookTableUrl || restaurantPage ? (
<div className={styles.ctaWrapper}> <div className={styles.ctaWrapper}>
{bookTableUrl ? ( {bookTableUrl ? (
@@ -92,10 +100,12 @@ export default async function RestaurantBarItem({
trackingId="book a table" trackingId="book a table"
trackingParams={{ restaurantName: name }} trackingParams={{ restaurantName: name }}
> >
{intl.formatMessage({ id: "Book a table online" })} {restaurantPage && !mainBody?.length
? intl.formatMessage({ id: "Read more & book a table" })
: intl.formatMessage({ id: "Book a table online" })}
</ButtonLink> </ButtonLink>
) : null} ) : null}
{restaurantPage ? ( {restaurantPage && mainBody?.length ? (
<ButtonLink <ButtonLink
fullWidth fullWidth
theme="base" theme="base"