Merged in feat/SW-1356-reward-night-booking-2- (pull request #1559)
feat: SW-1356 Reward night bookingflow * feat: SW-1356 Reward night bookingflow * feat: SW-1356 Removed extra param booking call * feat: SW-1356 Optimized as review comments * feat: SW-1356 Schema validation updates * feat: SW-1356 Fix after rebase * feat: SW-1356 Optimised price.redemptions check * feat: SW-1356 Updated Props naming Approved-by: Arvid Norlin
This commit is contained in:
@@ -3,17 +3,16 @@ import { useIntl } from "react-intl"
|
||||
import Caption from "@/components/TempDesignSystem/Text/Caption"
|
||||
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
||||
|
||||
import styles from "./hotelPointsCard.module.css"
|
||||
import styles from "./hotelPointsRow.module.css"
|
||||
|
||||
import type { PointsCardProps } from "@/types/components/hotelReservation/selectHotel/priceCardProps"
|
||||
import type { PointsRowProps } from "@/types/components/hotelReservation/selectHotel/priceCardProps"
|
||||
|
||||
export default function HotelPointsCard({
|
||||
productTypePoints,
|
||||
redemptionPrice,
|
||||
}: PointsCardProps) {
|
||||
export default function HotelPointsRow({
|
||||
pointsPerStay,
|
||||
additionalPricePerStay,
|
||||
additionalPriceCurrency,
|
||||
}: PointsRowProps) {
|
||||
const intl = useIntl()
|
||||
const pointsPerStay =
|
||||
productTypePoints?.localPrice.pointsPerStay ?? redemptionPrice
|
||||
|
||||
return (
|
||||
<div className={styles.poinstRow}>
|
||||
@@ -23,14 +22,14 @@ export default function HotelPointsCard({
|
||||
<Caption color="uiTextHighContrast">
|
||||
{intl.formatMessage({ id: "Points" })}
|
||||
</Caption>
|
||||
{productTypePoints?.localPrice.pricePerStay ? (
|
||||
{additionalPricePerStay ? (
|
||||
<>
|
||||
+
|
||||
<Subtitle type="two" color="uiTextHighContrast">
|
||||
{productTypePoints.localPrice.pricePerStay}
|
||||
{additionalPricePerStay}
|
||||
</Subtitle>
|
||||
<Caption color="uiTextHighContrast">
|
||||
{productTypePoints.localPrice.currency}
|
||||
{additionalPriceCurrency}
|
||||
</Caption>
|
||||
</>
|
||||
) : null}
|
||||
@@ -22,7 +22,7 @@ import { getSingleDecimal } from "@/utils/numberFormatting"
|
||||
|
||||
import ReadMore from "../ReadMore"
|
||||
import TripAdvisorChip from "../TripAdvisorChip"
|
||||
import HotelPointsCard from "./HotelPointsCard"
|
||||
import HotelPointsRow from "./HotelPointsRow"
|
||||
import HotelPriceCard from "./HotelPriceCard"
|
||||
import NoPriceAvailableCard from "./NoPriceAvailableCard"
|
||||
import { hotelCardVariants } from "./variants"
|
||||
@@ -154,9 +154,7 @@ function HotelCard({
|
||||
) : (
|
||||
<>
|
||||
{bookingCode && (
|
||||
<span
|
||||
className={`${styles.bookingCode} ${fullPrice ? styles.strikedText : ""}`}
|
||||
>
|
||||
<span className={`${fullPrice ? styles.strikedText : ""}`}>
|
||||
<PriceTagIcon height={20} width={20} />
|
||||
{bookingCode}
|
||||
</span>
|
||||
@@ -173,21 +171,23 @@ function HotelCard({
|
||||
isMemberPrice
|
||||
/>
|
||||
)}
|
||||
{price?.redemption && (
|
||||
{!!price?.redemptions?.length && (
|
||||
<div className={styles.pointsCard}>
|
||||
<Caption>
|
||||
{intl.formatMessage({ id: "Available rates" })}
|
||||
</Caption>
|
||||
{/* Display rate with full points option */}
|
||||
<HotelPointsCard productTypePoints={price.redemption} />
|
||||
{/* Display rate with partial points option A */}
|
||||
{price.redemptionA && (
|
||||
<HotelPointsCard productTypePoints={price.redemptionA} />
|
||||
)}
|
||||
{/* Display rate with partial points option B */}
|
||||
{price.redemptionB && (
|
||||
<HotelPointsCard productTypePoints={price.redemptionB} />
|
||||
)}
|
||||
{price.redemptions.map((redemption) => (
|
||||
<HotelPointsRow
|
||||
key={redemption.rateCode}
|
||||
pointsPerStay={redemption.localPrice.pointsPerStay}
|
||||
additionalPricePerStay={
|
||||
redemption.localPrice.additionalPricePerStay
|
||||
}
|
||||
additionalPriceCurrency={
|
||||
redemption.localPrice.additionalPriceCurrency
|
||||
}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user