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