Merged in feat/SW-1737-design-mystay-multiroom (pull request #1565)

Feat/SW-1737 design mystay multiroom

* feat(SW-1737) Fixed member view of guest details

* feat(SW-1737) fix merge issues

* feat(SW-1737) Fixed price details

* feat(SW-1737) removed unused imports

* feat(SW-1737) removed true as statement

* feat(SW-1737) updated store handling

* feat(SW-1737) fixed bug showing double numbers

* feat(SW-1737) small design fixed

* feat(SW-1737) fixed rebase errors

* feat(SW-1737) fixed create booking error with dates

* feat(SW-1737) fixed view multiroom as singleroom

* feat(SW-1737) fixes for multiroom

* feat(SW-1737) fixed bookingsummary

* feat(SW-1737) dont hide modify dates

* feat(SW-1737) updated breakfast to handle number

* feat(SW-1737) Added red color if member rate

* feat(SW-1737) fix PR comments

* feat(SW-1737) updated member tiers svg

* feat(SW-1737) updated how to handle paymentMethodDescription

* feat(SW-1737) fixes after testing mystay

* feat(SW-1737) updated Room type to just use whats used

* feat(SW-1737) fixed access

* feat(SW-1737) refactor my stay after PR comments

* feat(SW-1737) fix roomNumber translation

* feat(SW-1737) removed log


Approved-by: Arvid Norlin
This commit is contained in:
Pontus Dreij
2025-03-24 09:30:10 +00:00
parent c5e294c7ea
commit 74c5b47319
117 changed files with 5899 additions and 1901 deletions

View File

@@ -1,6 +1,5 @@
import { cookies } from "next/headers"
import { notFound } from "next/navigation"
import { Suspense } from "react"
import { homeHrefs } from "@/constants/homeHrefs"
import { env } from "@/env/server"
@@ -19,7 +18,6 @@ import { getIntl } from "@/i18n"
import { getLang } from "@/i18n/serverContext"
import AdditionalInfoForm from "../FindMyBooking/AdditionalInfoForm"
import LinkedReservationSkeleton from "./LinkedReservation/LinkedReservationSkeleton"
import accessBooking, {
ACCESS_GRANTED,
ERROR_BAD_REQUEST,
@@ -28,10 +26,9 @@ import accessBooking, {
import { Ancillaries } from "./Ancillaries"
import BookingSummary from "./BookingSummary"
import { Header } from "./Header"
import LinkedReservation from "./LinkedReservation"
import Promo from "./Promo"
import { ReferenceCard } from "./ReferenceCard"
import { Room } from "./Room"
import Rooms from "./Rooms"
import styles from "./myStay.module.css"
@@ -53,12 +50,6 @@ export async function MyStay({ refId }: { refId: string }) {
const access = accessBooking(booking.guest, lastName, user, bv)
if (access === ACCESS_GRANTED) {
const linkedBookingPromises = booking.linkedReservations
? booking.linkedReservations.map((linkedBooking) => {
return getBookingConfirmation(linkedBooking.confirmationNumber)
})
: []
const lang = getLang()
const ancillaryPackages = await getAncillaryPackages({
fromDate: dt(booking.checkInDate).format("YYYY-MM-DD"),
@@ -94,9 +85,10 @@ export async function MyStay({ refId }: { refId: string }) {
<ReferenceCard
booking={booking}
hotel={hotel}
user={user}
savedCreditCards={savedCreditCards}
refId={refId}
room={room}
isLoggedIn={!!user}
/>
</div>
{booking.showAncillaries && (
@@ -108,28 +100,18 @@ export async function MyStay({ refId }: { refId: string }) {
refId={refId}
/>
)}
<div>
<Room booking={booking} room={room} hotel={hotel} user={user} />
{booking.linkedReservations.map((linkedRes, index) => (
<Suspense
key={linkedRes.confirmationNumber}
fallback={<LinkedReservationSkeleton />}
>
<LinkedReservation
bookingPromise={linkedBookingPromises[index]}
index={index}
/>
</Suspense>
))}
</div>
<BookingSummary booking={booking} hotel={hotel} room={room} />
<Rooms booking={booking} room={room} hotel={hotel} user={user} />
<BookingSummary hotel={hotel} />
<Promo
buttonText={intl.formatMessage({ id: "Book another stay" })}
href={`${homeHrefs[env.NODE_ENV][lang]}?hotel=${hotel.operaId}`}
title={intl.formatMessage({ id: "Book your next stay" })}
text={intl.formatMessage({
id: "Get inspired and start dreaming beyond your next trip. Explore more Scandic destinations.",
})}
title={intl.formatMessage({ id: "Book your next stay" })}
buttonText={intl.formatMessage({ id: "Explore Scandic hotels" })}
href={`${homeHrefs[env.NODE_ENV][lang]}?hotel=${hotel.operaId}`}
image={hotel.hotelContent.images}
/>
</div>
</main>