Merged in feat/SW-1540-fetch-updated-data-booking (pull request #1316)
feat(SW-1540): Fetch data from API for MyStay * feat(SW-1540): Fetch data from API for MyStay * feat(SW-1540): Moved myStaySkeleton * feat(SW-1540) used memoized getBookingConfirmation instead Approved-by: Michael Zetterberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,18 +1,19 @@
|
|||||||
import { MyStay } from "@/components/HotelReservation/MyStay/MyStay"
|
import { Suspense } from "react"
|
||||||
import { setLang } from "@/i18n/serverContext"
|
|
||||||
|
|
||||||
import { response } from "./temporary_response"
|
import { MyStay } from "@/components/HotelReservation/MyStay/MyStay"
|
||||||
|
import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/MyStay/myStaySkeleton"
|
||||||
|
import { setLang } from "@/i18n/serverContext"
|
||||||
|
|
||||||
import type { LangParams, PageArgs } from "@/types/params"
|
import type { LangParams, PageArgs } from "@/types/params"
|
||||||
|
|
||||||
export default async function MyStayPage({ params }: PageArgs<LangParams>) {
|
export default async function MyStayPage({
|
||||||
|
params,
|
||||||
|
}: PageArgs<LangParams & { refId: string }>) {
|
||||||
setLang(params.lang)
|
setLang(params.lang)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MyStay
|
<Suspense fallback={<MyStaySkeleton />}>
|
||||||
hotel={response.hotel}
|
<MyStay reservationId={params.refId} />
|
||||||
booking={response.booking}
|
</Suspense>
|
||||||
room={response.room}
|
|
||||||
/>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,3 +1,5 @@
|
|||||||
|
import { getBookingConfirmation } from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
import Divider from "@/components/TempDesignSystem/Divider"
|
import Divider from "@/components/TempDesignSystem/Divider"
|
||||||
|
|
||||||
import HotelDetails from "../../BookingConfirmation/HotelDetails"
|
import HotelDetails from "../../BookingConfirmation/HotelDetails"
|
||||||
@@ -10,9 +12,9 @@ import { Header } from "./Header"
|
|||||||
|
|
||||||
import styles from "./myStay.module.css"
|
import styles from "./myStay.module.css"
|
||||||
|
|
||||||
import type { ConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation"
|
export async function MyStay({ reservationId }: { reservationId: string }) {
|
||||||
|
const { booking, hotel, room } = await getBookingConfirmation(reservationId)
|
||||||
|
|
||||||
export function MyStay({ room, hotel, booking }: ConfirmationProps) {
|
|
||||||
return (
|
return (
|
||||||
<main className={styles.main}>
|
<main className={styles.main}>
|
||||||
<Header booking={booking} hotel={hotel} />
|
<Header booking={booking} hotel={hotel} />
|
||||||
|
|||||||
@@ -8,3 +8,41 @@
|
|||||||
padding-top: var(--Spacing-x5);
|
padding-top: var(--Spacing-x5);
|
||||||
width: var(--max-width-page);
|
width: var(--max-width-page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.headerSkeleton {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: var(--Spacing-x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.bookingActionsSkeleton {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: var(--Spacing-x2);
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bookingActionsSkeletonButtons {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: var(--Spacing-x1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.ancillariesSkeleton {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: var(--Spacing-x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.paymentDetailsSkeleton {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: var(--Spacing-x2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.hotelDetailsSkeleton {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: var(--Spacing-x2);
|
||||||
|
}
|
||||||
|
|||||||
47
components/HotelReservation/MyStay/MyStay/myStaySkeleton.tsx
Normal file
47
components/HotelReservation/MyStay/MyStay/myStaySkeleton.tsx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import SkeletonShimmer from "@/components/SkeletonShimmer"
|
||||||
|
import Divider from "@/components/TempDesignSystem/Divider"
|
||||||
|
|
||||||
|
import styles from "./myStay.module.css"
|
||||||
|
|
||||||
|
export async function MyStaySkeleton() {
|
||||||
|
return (
|
||||||
|
<div className={styles.main}>
|
||||||
|
<div className={styles.headerSkeleton}>
|
||||||
|
<SkeletonShimmer width={"100%"} height="40px" />
|
||||||
|
<SkeletonShimmer width={"300px"} height="30px" />
|
||||||
|
</div>
|
||||||
|
<div className={styles.bookingActionsSkeleton}>
|
||||||
|
<SkeletonShimmer width={"300px"} height="20px" />
|
||||||
|
<div className={styles.bookingActionsSkeletonButtons}>
|
||||||
|
<SkeletonShimmer width={"125px"} height="50px" />
|
||||||
|
<SkeletonShimmer width={"125px"} height="50px" />
|
||||||
|
<SkeletonShimmer width={"125px"} height="50px" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className={styles.roomSkeleton}>
|
||||||
|
<SkeletonShimmer width={"100%"} height="290px" />
|
||||||
|
</div>
|
||||||
|
<div className={styles.ancillariesSkeleton}>
|
||||||
|
<SkeletonShimmer width={"280px"} height="200px" />
|
||||||
|
<SkeletonShimmer width={"280px"} height="200px" />
|
||||||
|
<SkeletonShimmer width={"280px"} height="200px" />
|
||||||
|
<SkeletonShimmer width={"280px"} height="200px" />
|
||||||
|
<SkeletonShimmer width={"280px"} height="200px" />
|
||||||
|
</div>
|
||||||
|
<Divider color="primaryLightSubtle" />
|
||||||
|
<div className={styles.paymentDetailsSkeleton}>
|
||||||
|
<SkeletonShimmer width={"200px"} height="30px" />
|
||||||
|
<SkeletonShimmer width={"180px"} height="20px" />
|
||||||
|
<SkeletonShimmer width={"190px"} height="20px" />
|
||||||
|
<SkeletonShimmer width={"170px"} height="20px" />
|
||||||
|
</div>
|
||||||
|
<Divider color="primaryLightSubtle" />
|
||||||
|
<div className={styles.hotelDetailsSkeleton}>
|
||||||
|
<SkeletonShimmer width={"200px"} height="30px" />
|
||||||
|
<SkeletonShimmer width={"180px"} height="20px" />
|
||||||
|
<SkeletonShimmer width={"190px"} height="20px" />
|
||||||
|
<SkeletonShimmer width={"170px"} height="20px" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user