feat(SW-1012): remove title components

This commit is contained in:
Fredrik Thorsson
2024-12-17 11:42:32 +01:00
parent 0344d8f360
commit 66f6762b99
4 changed files with 17 additions and 30 deletions

View File

@@ -51,13 +51,18 @@ export default async function OpeningHours({
}) })
function formatDayInterval(days: string[]) { function formatDayInterval(days: string[]) {
if (days.length === 1) return days[0] if (days.length === 1) {
return `${days[0]}-${days[days.length - 1]}` return days[0]
} else {
return `${days[0]}-${days[days.length - 1]}`
}
} }
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
<Body textTransform="bold">{openingHours.name}</Body> <Body textTransform="bold" asChild>
<h5>{openingHours.name}</h5>
</Body>
{Object.entries(groupedOpeningHours).map(([time, days]) => { {Object.entries(groupedOpeningHours).map(([time, days]) => {
return ( return (
<Body color="uiTextHighContrast" key={time}> <Body color="uiTextHighContrast" key={time}>

View File

@@ -1,9 +1,10 @@
import NextLink from "next/link"
import { OpenInNewSmallIcon } from "@/components/Icons" import { OpenInNewSmallIcon } from "@/components/Icons"
import Image from "@/components/Image" import Image from "@/components/Image"
import Button from "@/components/TempDesignSystem/Button" import Button from "@/components/TempDesignSystem/Button"
import Link from "@/components/TempDesignSystem/Link" import Link from "@/components/TempDesignSystem/Link"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import Title from "@/components/TempDesignSystem/Text/Title"
import { getIntl } from "@/i18n" import { getIntl } from "@/i18n"
import OpeningHours from "../OpeningHours" import OpeningHours from "../OpeningHours"
@@ -28,7 +29,7 @@ export default async function RestaurantBarItem({
<div className={styles.restaurantBarItem}> <div className={styles.restaurantBarItem}>
<div className={styles.stickyHeading}> <div className={styles.stickyHeading}>
<Subtitle type="one" color="burgundy" asChild> <Subtitle type="one" color="burgundy" asChild>
<Title level="h3">{name}</Title> <h3>{name}</h3>
</Subtitle> </Subtitle>
</div> </div>
{visibleImages.length ? ( {visibleImages.length ? (
@@ -48,9 +49,7 @@ export default async function RestaurantBarItem({
{openingDetails.length ? ( {openingDetails.length ? (
<div className={styles.content}> <div className={styles.content}>
<Subtitle type="two" asChild> <Subtitle type="two" asChild>
<Title level="h4"> <h4>{intl.formatMessage({ id: "Opening Hours" })}</h4>
{intl.formatMessage({ id: "Opening Hours" })}
</Title>
</Subtitle> </Subtitle>
{openingDetails.map((details) => ( {openingDetails.map((details) => (
<OpeningHours <OpeningHours
@@ -64,7 +63,7 @@ export default async function RestaurantBarItem({
{menus.length ? ( {menus.length ? (
<div className={styles.content}> <div className={styles.content}>
<Subtitle type="two" asChild> <Subtitle type="two" asChild>
<Title level="h4">{intl.formatMessage({ id: "Menus" })}</Title> <h4>{intl.formatMessage({ id: "Menus" })}</h4>
</Subtitle> </Subtitle>
<ul className={styles.menuList}> <ul className={styles.menuList}>
{menus.map(({ name, url }) => ( {menus.map(({ name, url }) => (
@@ -88,21 +87,16 @@ export default async function RestaurantBarItem({
<div className={styles.ctaWrapper}> <div className={styles.ctaWrapper}>
{bookTableUrl ? ( {bookTableUrl ? (
<Button fullWidth theme="base" intent="primary" asChild> <Button fullWidth theme="base" intent="primary" asChild>
<Link <NextLink href={bookTableUrl} target="_blank">
href={bookTableUrl}
color="white"
weight="bold"
target="_blank"
>
{intl.formatMessage({ id: "Book a table online" })} {intl.formatMessage({ id: "Book a table online" })}
</Link> </NextLink>
</Button> </Button>
) : null} ) : null}
{ctaUrl ? ( {ctaUrl ? (
<Button fullWidth theme="base" intent="secondary" asChild> <Button fullWidth theme="base" intent="secondary" asChild>
<Link href={ctaUrl} color="burgundy" weight="bold"> <NextLink href={ctaUrl}>
{`${intl.formatMessage({ id: "Discover" })} ${name}`} {`${intl.formatMessage({ id: "Discover" })} ${name}`}
</Link> </NextLink>
</Button> </Button>
) : null} ) : null}
</div> </div>

View File

@@ -51,10 +51,6 @@ export const getHotelDataInputSchema = z.object({
isCardOnlyPayment: z.boolean().optional(), isCardOnlyPayment: z.boolean().optional(),
}) })
export const getRestaurantsInputSchema = z.object({
hotelId: z.string(),
})
export type HotelDataInput = z.input<typeof getHotelDataInputSchema> export type HotelDataInput = z.input<typeof getHotelDataInputSchema>
export const getBreakfastPackageInputSchema = z.object({ export const getBreakfastPackageInputSchema = z.object({

View File

@@ -51,14 +51,6 @@ const getHotelCounter = meter.createCounter("trpc.hotel.get")
const getHotelSuccessCounter = meter.createCounter("trpc.hotel.get-success") const getHotelSuccessCounter = meter.createCounter("trpc.hotel.get-success")
const getHotelFailCounter = meter.createCounter("trpc.hotel.get-fail") const getHotelFailCounter = meter.createCounter("trpc.hotel.get-fail")
const getRestaurantsCounter = meter.createCounter("trpc.hotel.restaurants.get")
const getRestaurantsSuccessCounter = meter.createCounter(
"trpc.hotel.restaurants.get-success"
)
const getRestaurantsFailCounter = meter.createCounter(
"trpc.hotel.restaurants.get-fail"
)
const getPackagesCounter = meter.createCounter("trpc.hotel.packages.get") const getPackagesCounter = meter.createCounter("trpc.hotel.packages.get")
const getPackagesSuccessCounter = meter.createCounter( const getPackagesSuccessCounter = meter.createCounter(
"trpc.hotel.packages.get-success" "trpc.hotel.packages.get-success"