feat: SW-1588 Optimized rate title
This commit is contained in:
@@ -20,6 +20,7 @@ export default function PriceList({
|
||||
publicPrice = {},
|
||||
memberPrice = {},
|
||||
petRoomPackage,
|
||||
rateTitle,
|
||||
}: PriceListProps) {
|
||||
const intl = useIntl()
|
||||
const { isMainRoom } = useRoomContext()
|
||||
@@ -68,29 +69,32 @@ export default function PriceList({
|
||||
const showOvertakingPrice =
|
||||
!memberLocalPrice && publicLocalPrice.regularPricePerNight
|
||||
|
||||
const priceLabelColor =
|
||||
rateTitle && !memberLocalPrice ? "red" : "uiTextHighContrast"
|
||||
|
||||
return (
|
||||
<dl className={styles.priceList}>
|
||||
{isUserLoggedIn && isMainRoom && memberLocalPrice ? null : (
|
||||
<div className={styles.priceRow}>
|
||||
<dt>
|
||||
<Caption
|
||||
type="bold"
|
||||
color={
|
||||
totalPublicLocalPricePerNight
|
||||
? "uiTextHighContrast"
|
||||
: "disabled"
|
||||
}
|
||||
>
|
||||
{intl.formatMessage({ id: "Standard price" })}
|
||||
</Caption>
|
||||
{rateTitle ? null : (
|
||||
<Caption
|
||||
type="bold"
|
||||
color={
|
||||
totalPublicLocalPricePerNight ? priceLabelColor : "disabled"
|
||||
}
|
||||
>
|
||||
{intl.formatMessage({ id: "Standard price" })}
|
||||
</Caption>
|
||||
)}
|
||||
</dt>
|
||||
<dd>
|
||||
{publicLocalPrice ? (
|
||||
<div className={styles.price}>
|
||||
<Subtitle type="two" color="uiTextHighContrast">
|
||||
<Subtitle type="two" color={priceLabelColor}>
|
||||
{totalPublicLocalPricePerNight}
|
||||
</Subtitle>
|
||||
<Body color="uiTextHighContrast" textTransform="bold">
|
||||
<Body color={priceLabelColor} textTransform="bold">
|
||||
{publicLocalPrice.currency}
|
||||
<span className={styles.perNight}>
|
||||
/{intl.formatMessage({ id: "night" })}
|
||||
|
||||
@@ -129,6 +129,7 @@ export default function FlexibilityOption({
|
||||
memberPrice={memberPrice}
|
||||
petRoomPackage={petRoomPackage}
|
||||
publicPrice={publicPrice}
|
||||
rateTitle={rateTitle}
|
||||
/>
|
||||
|
||||
<div className={styles.checkIcon}>
|
||||
|
||||
@@ -376,7 +376,11 @@ export default function RoomCard({ roomConfiguration }: RoomCardProps) {
|
||||
roomTypeCode={roomConfiguration.roomTypeCode}
|
||||
title={rate.title}
|
||||
priceInformation={rateDefinition?.generalTerms}
|
||||
rateTitle={rateDefinition?.title}
|
||||
rateTitle={
|
||||
product.productType.public.rateCode !== RateTypeEnum.Regular
|
||||
? rateDefinition?.title
|
||||
: undefined
|
||||
}
|
||||
/>
|
||||
)
|
||||
})}
|
||||
|
||||
@@ -23,11 +23,12 @@ export type FlexibilityOptionProps = {
|
||||
roomType: RoomConfiguration["roomType"]
|
||||
roomTypeCode: RoomConfiguration["roomTypeCode"]
|
||||
title: string
|
||||
rateTitle?: string // This is for special rates via booking codes
|
||||
rateTitle?: string // This is for the rates via booking codes
|
||||
}
|
||||
|
||||
export interface PriceListProps {
|
||||
publicPrice?: ProductPrice | Record<string, never>
|
||||
memberPrice?: ProductPrice | Record<string, never>
|
||||
petRoomPackage?: RoomPackage
|
||||
rateTitle?: string // This is for the rates via booking codes
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user