Merged in chore/SW-3397-move-confirmation-component-with (pull request #2759)
chore(SW-3397) Moved Confirmation component with Header to booking-flow package * chore(SW-3397) Moved Confirmation component with Header to booking-flow package * chore(SW-3397): Optimised code Approved-by: Anton Gunnarsson
This commit is contained in:
@@ -1,24 +0,0 @@
|
|||||||
"use client"
|
|
||||||
|
|
||||||
import { useRef } from "react"
|
|
||||||
|
|
||||||
import Header from "@/components/HotelReservation/BookingConfirmation/Header"
|
|
||||||
|
|
||||||
import styles from "./confirmation.module.css"
|
|
||||||
|
|
||||||
import type { ConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation"
|
|
||||||
|
|
||||||
export default function Confirmation({
|
|
||||||
booking,
|
|
||||||
hotel,
|
|
||||||
children,
|
|
||||||
}: React.PropsWithChildren<ConfirmationProps>) {
|
|
||||||
const mainRef = useRef<HTMLElement | null>(null)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<main className={styles.main} ref={mainRef}>
|
|
||||||
<Header booking={booking} hotel={hotel} mainRef={mainRef} />
|
|
||||||
{children}
|
|
||||||
</main>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -10,8 +10,9 @@ import Promo from "./Promo"
|
|||||||
|
|
||||||
import styles from "./promos.module.css"
|
import styles from "./promos.module.css"
|
||||||
|
|
||||||
|
import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
|
|
||||||
import type { PromosProps } from "@/types/components/hotelReservation/bookingConfirmation/promos"
|
import type { PromosProps } from "@/types/components/hotelReservation/bookingConfirmation/promos"
|
||||||
import type { AdditionalInfoCookieValue } from "../../FindMyBooking/AdditionalInfoForm"
|
|
||||||
|
|
||||||
export default function Promos({ booking }: PromosProps) {
|
export default function Promos({ booking }: PromosProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { notFound } from "next/navigation"
|
import { notFound } from "next/navigation"
|
||||||
|
|
||||||
|
import { Confirmation } from "@scandic-hotels/booking-flow/components/BookingConfirmation/Confirmation"
|
||||||
import BookingConfirmationProvider from "@scandic-hotels/booking-flow/providers/BookingConfirmationProvider"
|
import BookingConfirmationProvider from "@scandic-hotels/booking-flow/providers/BookingConfirmationProvider"
|
||||||
import { filterOverlappingDates } from "@scandic-hotels/booking-flow/utils/SelectRate"
|
import { filterOverlappingDates } from "@scandic-hotels/booking-flow/utils/SelectRate"
|
||||||
import { AlertTypeEnum } from "@scandic-hotels/common/constants/alert"
|
import { AlertTypeEnum } from "@scandic-hotels/common/constants/alert"
|
||||||
@@ -17,13 +18,15 @@ import Rooms from "@/components/HotelReservation/BookingConfirmation/Rooms"
|
|||||||
import SidePanel from "@/components/HotelReservation/SidePanel"
|
import SidePanel from "@/components/HotelReservation/SidePanel"
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
|
|
||||||
import Confirmation from "./Confirmation"
|
|
||||||
import Tracking from "./Tracking"
|
import Tracking from "./Tracking"
|
||||||
import { mapRoomState } from "./utils"
|
import { mapRoomState } from "./utils"
|
||||||
|
|
||||||
import styles from "./bookingConfirmation.module.css"
|
import styles from "./bookingConfirmation.module.css"
|
||||||
|
|
||||||
import type { BookingConfirmationProps } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation"
|
type BookingConfirmationProps = {
|
||||||
|
refId: string
|
||||||
|
membershipFailedError: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export default async function BookingConfirmation({
|
export default async function BookingConfirmation({
|
||||||
refId,
|
refId,
|
||||||
|
|||||||
@@ -4,13 +4,12 @@ import { CurrencyEnum } from "@scandic-hotels/common/constants/currency"
|
|||||||
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
import { formatPrice } from "@scandic-hotels/common/utils/numberFormatting"
|
||||||
import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
|
import { BreakfastPackageEnum } from "@scandic-hotels/trpc/enums/breakfast"
|
||||||
|
|
||||||
|
import type { BookingConfirmationRoom } from "@scandic-hotels/booking-flow/types/components/bookingConfirmation/bookingConfirmation"
|
||||||
import type {
|
import type {
|
||||||
BookingConfirmationSchema,
|
BookingConfirmationSchema,
|
||||||
PackageSchema,
|
PackageSchema,
|
||||||
} from "@scandic-hotels/trpc/types/bookingConfirmation"
|
} from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||||
|
|
||||||
import type { BookingConfirmationRoom } from "@/types/components/hotelReservation/bookingConfirmation/bookingConfirmation"
|
|
||||||
|
|
||||||
export function mapRoomState(
|
export function mapRoomState(
|
||||||
booking: BookingConfirmationSchema,
|
booking: BookingConfirmationSchema,
|
||||||
room: BookingConfirmationRoom,
|
room: BookingConfirmationRoom,
|
||||||
|
|||||||
@@ -18,12 +18,7 @@ import {
|
|||||||
|
|
||||||
import styles from "./findMyBooking.module.css"
|
import styles from "./findMyBooking.module.css"
|
||||||
|
|
||||||
export type AdditionalInfoCookieValue = {
|
import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
firstName: string
|
|
||||||
email: string
|
|
||||||
confirmationNumber: string
|
|
||||||
lastName: string
|
|
||||||
}
|
|
||||||
|
|
||||||
export default function AdditionalInfoForm({
|
export default function AdditionalInfoForm({
|
||||||
confirmationNumber,
|
confirmationNumber,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import { type FindMyBookingFormSchema, findMyBookingFormSchema } from "./schema"
|
|||||||
|
|
||||||
import styles from "./findMyBooking.module.css"
|
import styles from "./findMyBooking.module.css"
|
||||||
|
|
||||||
import type { AdditionalInfoCookieValue } from "./AdditionalInfoForm"
|
import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
|
|
||||||
export default function FindMyBooking() {
|
export default function FindMyBooking() {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|||||||
@@ -15,9 +15,7 @@ import {
|
|||||||
getProfileSafely,
|
getProfileSafely,
|
||||||
} from "@/lib/trpc/memoizedRequests"
|
} from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
import AdditionalInfoForm, {
|
import AdditionalInfoForm from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
|
||||||
type AdditionalInfoCookieValue,
|
|
||||||
} from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
|
|
||||||
import { getIntl } from "@/i18n"
|
import { getIntl } from "@/i18n"
|
||||||
import { isLoggedInUser } from "@/utils/isLoggedInUser"
|
import { isLoggedInUser } from "@/utils/isLoggedInUser"
|
||||||
|
|
||||||
@@ -33,6 +31,7 @@ import Tracking from "./tracking"
|
|||||||
|
|
||||||
import styles from "./receipt.module.css"
|
import styles from "./receipt.module.css"
|
||||||
|
|
||||||
|
import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||||
|
|
||||||
export async function Receipt({ refId }: { refId: string }) {
|
export async function Receipt({ refId }: { refId: string }) {
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
import { usePathname } from "next/navigation"
|
import { usePathname } from "next/navigation"
|
||||||
|
|
||||||
|
import { AddToCalendar } from "@scandic-hotels/booking-flow/components/AddToCalendar"
|
||||||
|
import { generateDateTime } from "@scandic-hotels/booking-flow/components/BookingConfirmation/Header/Actions/helpers"
|
||||||
|
|
||||||
import { isWebview } from "@/constants/routes/webviews"
|
import { isWebview } from "@/constants/routes/webviews"
|
||||||
import { useMyStayStore } from "@/stores/my-stay"
|
import { useMyStayStore } from "@/stores/my-stay"
|
||||||
|
|
||||||
import AddToCalendar from "@/components/HotelReservation/AddToCalendar"
|
|
||||||
import { generateDateTime } from "@/components/HotelReservation/BookingConfirmation/Header/Actions/helpers"
|
|
||||||
|
|
||||||
import { dateHasPassed } from "../utils"
|
import { dateHasPassed } from "../utils"
|
||||||
import AddToCalendarButton from "./AddToCalendarButton"
|
import AddToCalendarButton from "./AddToCalendarButton"
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ import accessBooking, {
|
|||||||
ERROR_UNAUTHORIZED,
|
ERROR_UNAUTHORIZED,
|
||||||
} from "./accessBooking"
|
} from "./accessBooking"
|
||||||
|
|
||||||
|
import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
import type { Guest } from "@scandic-hotels/trpc/routers/booking/output"
|
import type { Guest } from "@scandic-hotels/trpc/routers/booking/output"
|
||||||
|
|
||||||
import type { SafeUser } from "@/types/user"
|
import type { SafeUser } from "@/types/user"
|
||||||
import type { AdditionalInfoCookieValue } from "../FindMyBooking/AdditionalInfoForm"
|
|
||||||
|
|
||||||
describe("Access booking", () => {
|
describe("Access booking", () => {
|
||||||
describe("for logged in booking", () => {
|
describe("for logged in booking", () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
import type { Guest } from "@scandic-hotels/trpc/routers/booking/output"
|
import type { Guest } from "@scandic-hotels/trpc/routers/booking/output"
|
||||||
|
|
||||||
import type { SafeUser } from "@/types/user"
|
import type { SafeUser } from "@/types/user"
|
||||||
import type { AdditionalInfoCookieValue } from "../FindMyBooking/AdditionalInfoForm"
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
ACCESS_GRANTED,
|
ACCESS_GRANTED,
|
||||||
|
|||||||
@@ -21,9 +21,7 @@ import {
|
|||||||
getSavedPaymentCardsSafely,
|
getSavedPaymentCardsSafely,
|
||||||
} from "@/lib/trpc/memoizedRequests"
|
} from "@/lib/trpc/memoizedRequests"
|
||||||
|
|
||||||
import AdditionalInfoForm, {
|
import AdditionalInfoForm from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
|
||||||
type AdditionalInfoCookieValue,
|
|
||||||
} from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
|
|
||||||
import accessBooking, {
|
import accessBooking, {
|
||||||
ACCESS_GRANTED,
|
ACCESS_GRANTED,
|
||||||
ERROR_BAD_REQUEST,
|
ERROR_BAD_REQUEST,
|
||||||
@@ -42,6 +40,7 @@ import { isLoggedInUser } from "@/utils/isLoggedInUser"
|
|||||||
|
|
||||||
import styles from "./index.module.css"
|
import styles from "./index.module.css"
|
||||||
|
|
||||||
|
import type { AdditionalInfoCookieValue } from "@scandic-hotels/booking-flow/types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
import type { Lang } from "@scandic-hotels/common/constants/language"
|
import type { Lang } from "@scandic-hotels/common/constants/language"
|
||||||
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||||
|
|
||||||
|
|||||||
@@ -93,7 +93,6 @@
|
|||||||
"react-hook-form": "^7.56.2",
|
"react-hook-form": "^7.56.2",
|
||||||
"react-international-phone": "^4.5.0",
|
"react-international-phone": "^4.5.0",
|
||||||
"react-intl": "^7.1.11",
|
"react-intl": "^7.1.11",
|
||||||
"react-to-print": "^3.1.0",
|
|
||||||
"server-only": "^0.0.1",
|
"server-only": "^0.0.1",
|
||||||
"supercluster": "^8.0.1",
|
"supercluster": "^8.0.1",
|
||||||
"usehooks-ts": "3.1.1",
|
"usehooks-ts": "3.1.1",
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import type { RouterOutput } from "@scandic-hotels/trpc/client"
|
|
||||||
import type { EventAttributes } from "ics"
|
|
||||||
|
|
||||||
export interface AddToCalendarProps {
|
|
||||||
checkInDate: NonNullable<
|
|
||||||
RouterOutput["booking"]["get"]
|
|
||||||
>["booking"]["checkInDate"]
|
|
||||||
event: EventAttributes
|
|
||||||
hotelName: NonNullable<RouterOutput["booking"]["get"]>["hotel"]["name"]
|
|
||||||
renderButton: (onPress: () => Promise<void>) => React.ReactNode
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
|
||||||
|
|
||||||
export interface ManageBookingProps
|
|
||||||
extends Pick<BookingConfirmation, "booking"> {}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import type {
|
|
||||||
BookingConfirmation,
|
|
||||||
BookingConfirmationSchema,
|
|
||||||
} from "@scandic-hotels/trpc/types/bookingConfirmation"
|
|
||||||
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
|
||||||
|
|
||||||
export interface BookingConfirmationProps {
|
|
||||||
refId: string
|
|
||||||
membershipFailedError: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BookingConfirmationRoom extends Room {
|
|
||||||
bedType: Room["roomTypes"][number]
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ConfirmationProps
|
|
||||||
extends Pick<BookingConfirmation, "booking" | "hotel"> {
|
|
||||||
room: BookingConfirmationRoom
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface BookingConfirmationAlertsProps {
|
|
||||||
booking: BookingConfirmationSchema
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
|
||||||
import type { MutableRefObject } from "react"
|
|
||||||
|
|
||||||
export interface BookingConfirmationHeaderProps
|
|
||||||
extends Pick<BookingConfirmation, "booking" | "hotel"> {
|
|
||||||
mainRef: MutableRefObject<HTMLElement | null>
|
|
||||||
}
|
|
||||||
@@ -1,16 +1,25 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import { createEvent } from "ics"
|
import { createEvent, type EventAttributes } from "ics"
|
||||||
import { useIntl } from "react-intl"
|
import { useIntl } from "react-intl"
|
||||||
|
|
||||||
import { dt } from "@scandic-hotels/common/dt"
|
import { dt } from "@scandic-hotels/common/dt"
|
||||||
import { logger } from "@scandic-hotels/common/logger"
|
import { logger } from "@scandic-hotels/common/logger"
|
||||||
import { toast } from "@scandic-hotels/design-system/Toast"
|
import { toast } from "@scandic-hotels/design-system/Toast"
|
||||||
|
|
||||||
import useLang from "@/hooks/useLang"
|
import useLang from "../../hooks/useLang"
|
||||||
|
|
||||||
import type { AddToCalendarProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/addToCalendar"
|
import type { RouterOutput } from "@scandic-hotels/trpc/client"
|
||||||
|
|
||||||
export default function AddToCalendar({
|
type AddToCalendarProps = {
|
||||||
|
checkInDate: NonNullable<
|
||||||
|
RouterOutput["booking"]["get"]
|
||||||
|
>["booking"]["checkInDate"]
|
||||||
|
event: EventAttributes
|
||||||
|
hotelName: NonNullable<RouterOutput["booking"]["get"]>["hotel"]["name"]
|
||||||
|
renderButton: (onPress: () => Promise<void>) => React.ReactNode
|
||||||
|
}
|
||||||
|
|
||||||
|
export function AddToCalendar({
|
||||||
checkInDate,
|
checkInDate,
|
||||||
event,
|
event,
|
||||||
hotelName,
|
hotelName,
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import { useRef } from "react"
|
||||||
|
|
||||||
|
import { Header } from "../Header"
|
||||||
|
|
||||||
|
import styles from "./confirmation.module.css"
|
||||||
|
|
||||||
|
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||||
|
|
||||||
|
import type { BookingConfirmationRoom } from "../../../types/components/bookingConfirmation/bookingConfirmation"
|
||||||
|
|
||||||
|
interface ConfirmationProps
|
||||||
|
extends Pick<BookingConfirmation, "booking" | "hotel"> {
|
||||||
|
room: BookingConfirmationRoom
|
||||||
|
}
|
||||||
|
|
||||||
|
export function Confirmation({
|
||||||
|
booking,
|
||||||
|
hotel,
|
||||||
|
children,
|
||||||
|
}: React.PropsWithChildren<ConfirmationProps>) {
|
||||||
|
const mainRef = useRef<HTMLElement | null>(null)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<main className={styles.main} ref={mainRef}>
|
||||||
|
<Header booking={booking} hotel={hotel} mainRef={mainRef} />
|
||||||
|
{children}
|
||||||
|
</main>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -4,11 +4,7 @@ import { useIntl } from "react-intl"
|
|||||||
import { Button } from "@scandic-hotels/design-system/Button"
|
import { Button } from "@scandic-hotels/design-system/Button"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
export default function AddToCalendarButton({
|
export function AddToCalendarButton({ onPress }: { onPress: () => void }) {
|
||||||
onPress,
|
|
||||||
}: {
|
|
||||||
onPress: () => void
|
|
||||||
}) {
|
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -5,7 +5,7 @@ import { useReactToPrint } from "react-to-print"
|
|||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
import { OldDSButton as Button } from "@scandic-hotels/design-system/OldDSButton"
|
||||||
|
|
||||||
import type { DownloadInvoiceProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/downloadInvoice"
|
import type { DownloadInvoiceProps } from "../../../../types/components/bookingConfirmation/actions/downloadInvoice"
|
||||||
|
|
||||||
export default function DownloadInvoice({ mainRef }: DownloadInvoiceProps) {
|
export default function DownloadInvoice({ mainRef }: DownloadInvoiceProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
@@ -7,10 +7,13 @@ import { myStay } from "@scandic-hotels/common/constants/routes/myStay"
|
|||||||
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
import ButtonLink from "@scandic-hotels/design-system/ButtonLink"
|
||||||
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
import { MaterialIcon } from "@scandic-hotels/design-system/Icons/MaterialIcon"
|
||||||
|
|
||||||
import useLang from "@/hooks/useLang"
|
import useLang from "../../../../hooks/useLang"
|
||||||
|
|
||||||
import type { ManageBookingProps } from "@/types/components/hotelReservation/bookingConfirmation/actions/manageBooking"
|
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||||
import type { AdditionalInfoCookieValue } from "@/components/HotelReservation/FindMyBooking/AdditionalInfoForm"
|
|
||||||
|
import type { AdditionalInfoCookieValue } from "../../../../types/components/findMyBooking/additionalInfoCookieValue"
|
||||||
|
|
||||||
|
interface ManageBookingProps extends Pick<BookingConfirmation, "booking"> {}
|
||||||
|
|
||||||
export default function ManageBooking({ booking }: ManageBookingProps) {
|
export default function ManageBooking({ booking }: ManageBookingProps) {
|
||||||
const intl = useIntl()
|
const intl = useIntl()
|
||||||
@@ -5,19 +5,24 @@ import { useIntl } from "react-intl"
|
|||||||
import Body from "@scandic-hotels/design-system/Body"
|
import Body from "@scandic-hotels/design-system/Body"
|
||||||
import Title from "@scandic-hotels/design-system/Title"
|
import Title from "@scandic-hotels/design-system/Title"
|
||||||
|
|
||||||
import AddToCalendar from "../../AddToCalendar"
|
import { AddToCalendar } from "../../AddToCalendar"
|
||||||
import AddToCalendarButton from "./Actions/AddToCalendarButton"
|
import { AddToCalendarButton } from "./Actions/AddToCalendarButton"
|
||||||
// import DownloadInvoice from "./Actions/DownloadInvoice"
|
// import DownloadInvoice from "./Actions/DownloadInvoice"
|
||||||
import { generateDateTime } from "./Actions/helpers"
|
import { generateDateTime } from "./Actions/helpers"
|
||||||
import ManageBooking from "./Actions/ManageBooking"
|
import ManageBooking from "./Actions/ManageBooking"
|
||||||
|
|
||||||
import styles from "./header.module.css"
|
import styles from "./header.module.css"
|
||||||
|
|
||||||
|
import type { BookingConfirmation } from "@scandic-hotels/trpc/types/bookingConfirmation"
|
||||||
import type { EventAttributes } from "ics"
|
import type { EventAttributes } from "ics"
|
||||||
|
import type { MutableRefObject } from "react"
|
||||||
|
|
||||||
import type { BookingConfirmationHeaderProps } from "@/types/components/hotelReservation/bookingConfirmation/header"
|
export interface BookingConfirmationHeaderProps
|
||||||
|
extends Pick<BookingConfirmation, "booking" | "hotel"> {
|
||||||
|
mainRef: MutableRefObject<HTMLElement | null>
|
||||||
|
}
|
||||||
|
|
||||||
export default function Header({
|
export function Header({
|
||||||
booking,
|
booking,
|
||||||
hotel,
|
hotel,
|
||||||
// mainRef,
|
// mainRef,
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import type { Room } from "@scandic-hotels/trpc/types/hotel"
|
||||||
|
|
||||||
|
export interface BookingConfirmationRoom extends Room {
|
||||||
|
bedType: Room["roomTypes"][number]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
export type AdditionalInfoCookieValue = {
|
||||||
|
firstName: string
|
||||||
|
email: string
|
||||||
|
confirmationNumber: string
|
||||||
|
lastName: string
|
||||||
|
}
|
||||||
@@ -20,6 +20,10 @@
|
|||||||
"./BookingWidget/FloatingBookingWidget": "./lib/components/BookingWidget/FloatingBookingWidget/index.tsx",
|
"./BookingWidget/FloatingBookingWidget": "./lib/components/BookingWidget/FloatingBookingWidget/index.tsx",
|
||||||
"./BookingWidget/Skeleton": "./lib/components/BookingWidget/Skeleton.tsx",
|
"./BookingWidget/Skeleton": "./lib/components/BookingWidget/Skeleton.tsx",
|
||||||
"./components/AdditionalAmenities": "./lib/components/AdditionalAmenities/index.tsx",
|
"./components/AdditionalAmenities": "./lib/components/AdditionalAmenities/index.tsx",
|
||||||
|
"./components/AddToCalendar": "./lib/components/AddToCalendar/index.tsx",
|
||||||
|
"./components/BookingConfirmation/Confirmation": "./lib/components/BookingConfirmation/Confirmation/index.tsx",
|
||||||
|
"./components/BookingConfirmation/Header/Actions/downloadInvoice": "./lib/components/BookingConfirmation/Header/Actions/downloadInvoice.ts",
|
||||||
|
"./components/BookingConfirmation/Header/Actions/helpers": "./lib/components/BookingConfirmation/Header/Actions/helpers.ts",
|
||||||
"./components/Contact": "./lib/components/Contact/index.tsx",
|
"./components/Contact": "./lib/components/Contact/index.tsx",
|
||||||
"./components/FnFNotAllowedAlert": "./lib/components/FnFNotAllowedAlert/index.tsx",
|
"./components/FnFNotAllowedAlert": "./lib/components/FnFNotAllowedAlert/index.tsx",
|
||||||
"./components/HotelDetailsSidePeek": "./lib/components/HotelDetailsSidePeek/index.tsx",
|
"./components/HotelDetailsSidePeek": "./lib/components/HotelDetailsSidePeek/index.tsx",
|
||||||
@@ -51,6 +55,8 @@
|
|||||||
"./stores/hotels-map": "./lib/stores/hotels-map.ts",
|
"./stores/hotels-map": "./lib/stores/hotels-map.ts",
|
||||||
"./stores/booking-confirmation": "./lib/stores/booking-confirmation/index.ts",
|
"./stores/booking-confirmation": "./lib/stores/booking-confirmation/index.ts",
|
||||||
"./types/components/selectRate/selectRate": "./lib/types/components/selectRate/selectRate.ts",
|
"./types/components/selectRate/selectRate": "./lib/types/components/selectRate/selectRate.ts",
|
||||||
|
"./types/components/bookingConfirmation/bookingConfirmation": "./lib/types/components/bookingConfirmation/bookingConfirmation.ts",
|
||||||
|
"./types/components/findMyBooking/additionalInfoCookieValue": "./lib/types/components/findMyBooking/additionalInfoCookieValue.ts",
|
||||||
"./types/stores/rates": "./lib/types/stores/rates.ts",
|
"./types/stores/rates": "./lib/types/stores/rates.ts",
|
||||||
"./types/stores/booking-confirmation": "./lib/types/stores/booking-confirmation.ts",
|
"./types/stores/booking-confirmation": "./lib/types/stores/booking-confirmation.ts",
|
||||||
"./utils/isSameBooking": "./lib/utils/isSameBooking.ts",
|
"./utils/isSameBooking": "./lib/utils/isSameBooking.ts",
|
||||||
@@ -71,6 +77,7 @@
|
|||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
"downshift": "^9.0.9",
|
"downshift": "^9.0.9",
|
||||||
"fast-deep-equal": "^3.1.0",
|
"fast-deep-equal": "^3.1.0",
|
||||||
|
"ics": "^3.8.1",
|
||||||
"json-stable-stringify-without-jsonify": "^1.0.1",
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
||||||
"motion": "^12.10.0",
|
"motion": "^12.10.0",
|
||||||
"nuqs": "^2.4.3",
|
"nuqs": "^2.4.3",
|
||||||
@@ -78,6 +85,7 @@
|
|||||||
"react-day-picker": "^9.6.7",
|
"react-day-picker": "^9.6.7",
|
||||||
"react-hook-form": "^7.56.2",
|
"react-hook-form": "^7.56.2",
|
||||||
"react-intl": "^7.1.11",
|
"react-intl": "^7.1.11",
|
||||||
|
"react-to-print": "^3.1.0",
|
||||||
"usehooks-ts": "3.1.1",
|
"usehooks-ts": "3.1.1",
|
||||||
"zustand": "^4.5.2"
|
"zustand": "^4.5.2"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -6063,6 +6063,7 @@ __metadata:
|
|||||||
eslint-plugin-import: "npm:^2.31.0"
|
eslint-plugin-import: "npm:^2.31.0"
|
||||||
eslint-plugin-simple-import-sort: "npm:^12.1.1"
|
eslint-plugin-simple-import-sort: "npm:^12.1.1"
|
||||||
fast-deep-equal: "npm:^3.1.0"
|
fast-deep-equal: "npm:^3.1.0"
|
||||||
|
ics: "npm:^3.8.1"
|
||||||
json-stable-stringify-without-jsonify: "npm:^1.0.1"
|
json-stable-stringify-without-jsonify: "npm:^1.0.1"
|
||||||
motion: "npm:^12.10.0"
|
motion: "npm:^12.10.0"
|
||||||
nuqs: "npm:^2.4.3"
|
nuqs: "npm:^2.4.3"
|
||||||
@@ -6070,6 +6071,7 @@ __metadata:
|
|||||||
react-day-picker: "npm:^9.6.7"
|
react-day-picker: "npm:^9.6.7"
|
||||||
react-hook-form: "npm:^7.56.2"
|
react-hook-form: "npm:^7.56.2"
|
||||||
react-intl: "npm:^7.1.11"
|
react-intl: "npm:^7.1.11"
|
||||||
|
react-to-print: "npm:^3.1.0"
|
||||||
typescript: "npm:5.8.3"
|
typescript: "npm:5.8.3"
|
||||||
usehooks-ts: "npm:3.1.1"
|
usehooks-ts: "npm:3.1.1"
|
||||||
vitest: "npm:^3.2.4"
|
vitest: "npm:^3.2.4"
|
||||||
@@ -6366,7 +6368,6 @@ __metadata:
|
|||||||
react-hook-form: "npm:^7.56.2"
|
react-hook-form: "npm:^7.56.2"
|
||||||
react-international-phone: "npm:^4.5.0"
|
react-international-phone: "npm:^4.5.0"
|
||||||
react-intl: "npm:^7.1.11"
|
react-intl: "npm:^7.1.11"
|
||||||
react-to-print: "npm:^3.1.0"
|
|
||||||
schema-dts: "npm:^1.1.5"
|
schema-dts: "npm:^1.1.5"
|
||||||
server-only: "npm:^0.0.1"
|
server-only: "npm:^0.0.1"
|
||||||
start-server-and-test: "npm:^2.0.11"
|
start-server-and-test: "npm:^2.0.11"
|
||||||
|
|||||||
Reference in New Issue
Block a user