diff --git a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx index 7d2099ab5..31d303851 100644 --- a/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx +++ b/apps/scandic-web/components/Forms/BookingWidget/FormContent/BookingCode/index.tsx @@ -37,6 +37,7 @@ export default function BookingCode() { setValue, formState: { errors }, getValues, + trigger, } = useFormContext() const bookingCode: BookingCodeSchema = getValues("bookingCode") @@ -52,6 +53,12 @@ export default function BookingCode() { function updateBookingCodeFormValue(value: string) { setValue("bookingCode.value", value, { shouldValidate: true }) + if (getValues("redemption")) { + setValue("redemption", false) + setTimeout(function () { + trigger("bookingCode.value") + }, 5000) + } } const closeIfOutside = useCallback( diff --git a/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsCard/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsCard/index.tsx index a8ba871d5..55ab4d4a1 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsCard/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCard/HotelPointsCard/index.tsx @@ -9,18 +9,21 @@ import type { PointsCardProps } from "@/types/components/hotelReservation/select export default function HotelPointsCard({ productTypePoints, + redemptionPrice, }: PointsCardProps) { const intl = useIntl() + const pointsPerStay = + productTypePoints?.localPrice.pricePerStay ?? redemptionPrice return (
- {productTypePoints.localPrice.pointsPerStay} + {pointsPerStay} {intl.formatMessage({ id: "Points" })} - {productTypePoints.localPrice.pricePerStay ? ( + {productTypePoints?.localPrice.pricePerStay ? ( <> + diff --git a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx index 8054f8066..f2be198d7 100644 --- a/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx +++ b/apps/scandic-web/components/HotelReservation/HotelCardDialog/ListingHotelCardDialog/index.tsx @@ -11,6 +11,7 @@ import Caption from "@/components/TempDesignSystem/Text/Caption" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" import { isValidClientSession } from "@/utils/clientSession" +import HotelPointsCard from "../../HotelCard/HotelPointsCard" import NoPriceAvailableCard from "../../HotelCard/NoPriceAvailableCard" import HotelCardDialogImage from "../HotelCardDialogImage" @@ -44,6 +45,7 @@ export default function ListingHotelCardDialog({ images, ratings, operaId, + redemptionPrice, } = data const firstImage = images[0]?.imageSizes?.small @@ -82,14 +84,20 @@ export default function ListingHotelCardDialog({
- {publicPrice || memberPrice ? ( + {publicPrice || memberPrice || redemptionPrice ? (
- - {intl.formatMessage({ id: "Per night from" })} - + {redemptionPrice ? ( + + {intl.formatMessage({ id: "Available rates" })} + + ) : ( + + {intl.formatMessage({ id: "Per night from" })} + + )}
- {publicPrice && !isUserLoggedIn && ( + {publicPrice && !isUserLoggedIn && memberPrice && ( <> {publicPrice} {currency} @@ -108,6 +116,9 @@ export default function ListingHotelCardDialog({ )} )} + {redemptionPrice && ( + + )}
- {publicPrice || memberPrice ? ( + {publicPrice || memberPrice || redemptionPrice ? ( <>
- - {intl.formatMessage({ id: "From" })} - + {redemptionPrice ? ( + + {intl.formatMessage({ id: "Available rates" })} + + ) : ( + + {intl.formatMessage({ id: "From" })} + + )} {publicPrice && !isUserLoggedIn && ( {intl.formatMessage( @@ -123,6 +131,9 @@ export default function StandaloneHotelCardDialog({ )} + {redemptionPrice && ( + + )}