fix(BOOK-418): Refactored StandaloneHotelCardDialog and fixed pricing issue when using redemption or booking codes

Approved-by: Bianca Widstam
This commit is contained in:
Erik Tiekstra
2025-10-20 10:40:38 +00:00
parent 710309b7eb
commit 3e3a7fc423
12 changed files with 605 additions and 412 deletions

View File

@@ -0,0 +1,36 @@
import { useIntl } from 'react-intl'
import { Typography } from '../../Typography'
interface RoomPriceProps extends React.HTMLAttributes<HTMLParagraphElement> {
price: number
currency: string
includePerNight?: boolean
}
export function RoomPrice({
price,
currency,
children,
includePerNight = true,
...props
}: RoomPriceProps) {
const intl = useIntl()
return (
<p {...props}>
<Typography variant="Title/Subtitle/md">
<span>{price}</span>
</Typography>
<Typography variant="Body/Paragraph/mdBold">
<span> {currency}</span>
</Typography>
{children}
{includePerNight ? (
<Typography variant="Body/Supporting text (caption)/smRegular">
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
<span>/{intl.formatMessage({ defaultMessage: 'night' })}</span>
</Typography>
) : null}
</p>
)
}