Merge branch 'master' of bitbucket.org:scandic-swap/web into fix/syncblocking-parallel-routes

This commit is contained in:
Joakim Jäderberg
2024-11-20 12:43:41 +01:00
79 changed files with 1001 additions and 603 deletions

View File

@@ -83,10 +83,10 @@ export default async function SummaryPage({
price: availability.publicRate.localPrice.pricePerStay,
currency: availability.publicRate.localPrice.currency,
},
euro: availability.publicRate.requestedPrice
euro: availability.publicRate?.requestedPrice
? {
price: availability.publicRate.requestedPrice.pricePerStay,
currency: availability.publicRate.requestedPrice.currency,
price: availability.publicRate?.requestedPrice.pricePerStay,
currency: availability.publicRate?.requestedPrice.currency,
}
: undefined,
}

View File

@@ -1,6 +1,6 @@
import "./enterDetailsLayout.css"
import { notFound, redirect, RedirectType } from "next/navigation"
import { notFound } from "next/navigation"
import {
getBreakfastPackages,
@@ -38,6 +38,8 @@ export default async function StepPage({
}: PageArgs<LangParams, SelectRateSearchParams & { step: StepEnum }>) {
const intl = await getIntl()
const selectRoomParams = new URLSearchParams(searchParams)
selectRoomParams.delete("step")
const searchParamsString = selectRoomParams.toString()
const {
hotel: hotelId,
rooms,
@@ -111,11 +113,19 @@ export default async function StepPage({
publicPrice: roomAvailability.publicRate!.localPrice.pricePerStay,
}
const memberPrice = roomAvailability.memberRate
? {
price: roomAvailability.memberRate.localPrice.pricePerStay,
currency: roomAvailability.memberRate.localPrice.currency,
}
: undefined
return (
<StepsProvider
bedTypes={roomAvailability.bedTypes}
breakfastPackages={breakfastPackages}
isMember={!!user}
searchParams={searchParamsString}
step={searchParams.step}
>
<section>
@@ -152,7 +162,7 @@ export default async function StepPage({
step={StepEnum.details}
label={intl.formatMessage({ id: "Enter your details" })}
>
<Details user={user} />
<Details user={user} memberPrice={memberPrice} />
</SectionAccordion>
<SectionAccordion