Merged in feature/warmup (pull request #1887)
* unified warmup function Approved-by: Linus Flood
This commit is contained in:
@@ -29,12 +29,8 @@ export default function Campaign({
|
||||
roomTypeCode,
|
||||
}: CampaignProps) {
|
||||
const intl = useIntl()
|
||||
const {
|
||||
roomNr,
|
||||
selectedFilter,
|
||||
selectedPackages,
|
||||
selectedRate,
|
||||
} = useRoomContext()
|
||||
const { roomNr, selectedFilter, selectedPackages, selectedRate } =
|
||||
useRoomContext()
|
||||
const rateTitles = useRateTitles()
|
||||
|
||||
const isCampaignRate = campaign.some(
|
||||
@@ -78,21 +74,21 @@ export default function Campaign({
|
||||
|
||||
const rateTermDetails = product.rateDefinitionMember
|
||||
? [
|
||||
{
|
||||
title: product.rateDefinition.title,
|
||||
terms: product.rateDefinition.generalTerms,
|
||||
},
|
||||
{
|
||||
title: product.rateDefinitionMember.title,
|
||||
terms: product.rateDefinition.generalTerms,
|
||||
},
|
||||
]
|
||||
{
|
||||
title: product.rateDefinition.title,
|
||||
terms: product.rateDefinition.generalTerms,
|
||||
},
|
||||
{
|
||||
title: product.rateDefinitionMember.title,
|
||||
terms: product.rateDefinition.generalTerms,
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
title: product.rateDefinition.title,
|
||||
terms: product.rateDefinition.generalTerms,
|
||||
},
|
||||
]
|
||||
{
|
||||
title: product.rateDefinition.title,
|
||||
terms: product.rateDefinition.generalTerms,
|
||||
},
|
||||
]
|
||||
|
||||
const isSelected = isSelectedPriceProduct(
|
||||
product,
|
||||
@@ -127,12 +123,12 @@ export default function Campaign({
|
||||
|
||||
const pricePerNightMember = product.member
|
||||
? calculatePricePerNightPriceProduct(
|
||||
product.member.localPrice.pricePerNight,
|
||||
product.member.requestedPrice?.pricePerNight,
|
||||
nights,
|
||||
pkgsSum.price,
|
||||
pkgsSumRequested.price
|
||||
)
|
||||
product.member.localPrice.pricePerNight,
|
||||
product.member.requestedPrice?.pricePerNight,
|
||||
nights,
|
||||
pkgsSum.price,
|
||||
pkgsSumRequested.price
|
||||
)
|
||||
: undefined
|
||||
|
||||
let approximateRatePrice = undefined
|
||||
@@ -148,12 +144,12 @@ export default function Campaign({
|
||||
const approximateRate =
|
||||
approximateRatePrice && product.public.requestedPrice
|
||||
? {
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Approx.",
|
||||
}),
|
||||
price: approximateRatePrice,
|
||||
unit: product.public.requestedPrice.currency,
|
||||
}
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Approx.",
|
||||
}),
|
||||
price: approximateRatePrice,
|
||||
unit: product.public.requestedPrice.currency,
|
||||
}
|
||||
: undefined
|
||||
|
||||
return (
|
||||
@@ -167,12 +163,12 @@ export default function Campaign({
|
||||
memberRate={
|
||||
pricePerNightMember
|
||||
? {
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Member price",
|
||||
}),
|
||||
price: pricePerNightMember.totalPrice,
|
||||
unit: `${product.member!.localPrice.currency}/${night}`,
|
||||
}
|
||||
label: intl.formatMessage({
|
||||
defaultMessage: "Member price",
|
||||
}),
|
||||
price: pricePerNightMember.totalPrice,
|
||||
unit: `${product.member!.localPrice.currency}/${night}`,
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
name={`rateCode-${roomNr}-${product.public.rateCode}`}
|
||||
@@ -186,15 +182,15 @@ export default function Campaign({
|
||||
omnibusRate={
|
||||
product.public.localPrice.omnibusPricePerNight
|
||||
? {
|
||||
label: intl
|
||||
.formatMessage({
|
||||
defaultMessage: "Lowest price (last 30 days)",
|
||||
})
|
||||
.toUpperCase(),
|
||||
price:
|
||||
product.public.localPrice.omnibusPricePerNight.toString(),
|
||||
unit: product.public.localPrice.currency,
|
||||
}
|
||||
label: intl
|
||||
.formatMessage({
|
||||
defaultMessage: "Lowest price (last 30 days)",
|
||||
})
|
||||
.toUpperCase(),
|
||||
price:
|
||||
product.public.localPrice.omnibusPricePerNight.toString(),
|
||||
unit: product.public.localPrice.currency,
|
||||
}
|
||||
: undefined
|
||||
}
|
||||
rateTermDetails={rateTermDetails}
|
||||
|
||||
@@ -79,9 +79,9 @@ export default function Redemptions({
|
||||
additionalPrice:
|
||||
additionalPrice && additionalPriceCurrency
|
||||
? {
|
||||
currency: additionalPriceCurrency,
|
||||
price: additionalPrice.toString(),
|
||||
}
|
||||
currency: additionalPriceCurrency,
|
||||
price: additionalPrice.toString(),
|
||||
}
|
||||
: undefined,
|
||||
currency: "PTS",
|
||||
isDisabled: !r.redemption.hasEnoughPoints,
|
||||
|
||||
Reference in New Issue
Block a user