From efa7336ebdc7f16462ba85f412f1865c84c4ac35 Mon Sep 17 00:00:00 2001 From: Niclas Edenvin Date: Mon, 24 Mar 2025 07:55:15 +0000 Subject: [PATCH] Merged in feat/sw-1602-preliminary-receipt (pull request #1595) feat/sw-1602 preliminary receipt * feat(sw-1602): create page for preliminary receipt * Add link to my stay page Approved-by: Pontus Dreij --- .../hotelreservation/my-stay/receipt/page.tsx | 20 ++ .../app/[lang]/(no-layout)/layout.tsx | 63 ++++++ .../ActionPanel/actionPanel.module.css | 8 +- .../MyStay/ManageStay/ActionPanel/index.tsx | 12 +- .../MyStay/Receipt/Footer/footer.module.css | 20 ++ .../MyStay/Receipt/Footer/index.tsx | 147 ++++++++++++++ .../MyStay/Receipt/Specification/index.tsx | 185 ++++++++++++++++++ .../Specification/specification.module.css | 26 +++ .../MyStay/Receipt/Total/index.tsx | 85 ++++++++ .../MyStay/Receipt/Total/total.module.css | 37 ++++ .../HotelReservation/MyStay/Receipt/index.tsx | 150 ++++++++++++++ .../MyStay/Receipt/receipt.module.css | 40 ++++ apps/scandic-web/constants/routes/myStay.js | 10 + apps/scandic-web/i18n/dictionaries/da.json | 13 ++ apps/scandic-web/i18n/dictionaries/de.json | 13 ++ apps/scandic-web/i18n/dictionaries/en.json | 13 ++ apps/scandic-web/i18n/dictionaries/fi.json | 13 ++ apps/scandic-web/i18n/dictionaries/no.json | 13 ++ apps/scandic-web/i18n/dictionaries/sv.json | 13 ++ .../hotelReservation/myStay/receipt.ts | 23 +++ apps/scandic-web/utils/dateFormatting.ts | 4 + 21 files changed, 902 insertions(+), 6 deletions(-) create mode 100644 apps/scandic-web/app/[lang]/(no-layout)/hotelreservation/my-stay/receipt/page.tsx create mode 100644 apps/scandic-web/app/[lang]/(no-layout)/layout.tsx create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/Footer/footer.module.css create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/Footer/index.tsx create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/Specification/index.tsx create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/Specification/specification.module.css create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/Total/index.tsx create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/Total/total.module.css create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/index.tsx create mode 100644 apps/scandic-web/components/HotelReservation/MyStay/Receipt/receipt.module.css create mode 100644 apps/scandic-web/types/components/hotelReservation/myStay/receipt.ts diff --git a/apps/scandic-web/app/[lang]/(no-layout)/hotelreservation/my-stay/receipt/page.tsx b/apps/scandic-web/app/[lang]/(no-layout)/hotelreservation/my-stay/receipt/page.tsx new file mode 100644 index 000000000..a5a66c0e0 --- /dev/null +++ b/apps/scandic-web/app/[lang]/(no-layout)/hotelreservation/my-stay/receipt/page.tsx @@ -0,0 +1,20 @@ +import { notFound } from "next/navigation" +import { Suspense } from "react" + +import { MyStaySkeleton } from "@/components/HotelReservation/MyStay/myStaySkeleton" +import { Receipt } from "@/components/HotelReservation/MyStay/Receipt" + +import type { LangParams, PageArgs } from "@/types/params" + +export default async function ReceiptPage({ + searchParams, +}: PageArgs) { + if (!searchParams.RefId) { + notFound() + } + return ( + }> + + + ) +} diff --git a/apps/scandic-web/app/[lang]/(no-layout)/layout.tsx b/apps/scandic-web/app/[lang]/(no-layout)/layout.tsx new file mode 100644 index 000000000..eb3256728 --- /dev/null +++ b/apps/scandic-web/app/[lang]/(no-layout)/layout.tsx @@ -0,0 +1,63 @@ +import "@scandic-hotels/design-system/fonts.css" +import "@/app/globals.css" +import "@/public/_static/css/design-system-new-deprecated.css" +import "@scandic-hotels/design-system/style.css" + +import { ReactQueryDevtools } from "@tanstack/react-query-devtools" +import Script from "next/script" +import { SessionProvider } from "next-auth/react" + +import TrpcProvider from "@/lib/trpc/Provider" + +import { SessionRefresher } from "@/components/Auth/TokenRefresher" +import CookieBotConsent from "@/components/CookieBot" +import StorageCleaner from "@/components/HotelReservation/EnterDetails/StorageCleaner" +import { ToastHandler } from "@/components/TempDesignSystem/Toasts" +import AdobeSDKScript from "@/components/TrackingSDK/AdobeSDKScript" +import GTMScript from "@/components/TrackingSDK/GTMScript" +import RouterTracking from "@/components/TrackingSDK/RouterTracking" +import { getIntl } from "@/i18n" +import ServerIntlProvider from "@/i18n/Provider" + +import type { LangParams, LayoutArgs } from "@/types/params" + +export default async function RootLayout({ + children, +}: React.PropsWithChildren>) { + const { defaultLocale, locale, messages } = await getIntl() + + return ( + <> + + + + + + + + + + + {children} + + + + + + + + + + + ) +} diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/actionPanel.module.css b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/actionPanel.module.css index 869d6ffc6..913c370dd 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/actionPanel.module.css +++ b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/actionPanel.module.css @@ -25,13 +25,19 @@ } } -.actionPanel .menu .button { +.actionPanel .menu .button, +.actionLink { width: 100%; color: var(--Scandic-Brand-Burgundy); justify-content: space-between !important; padding: var(--Spacing-x1) 0 !important; } +.actionLink { + font-weight: 500; + display: flex; +} + .info { width: 100%; background-color: var(--Base-Background-Primary-Normal); diff --git a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx index 3736365da..dc885bebc 100644 --- a/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx +++ b/apps/scandic-web/components/HotelReservation/MyStay/ManageStay/ActionPanel/index.tsx @@ -4,6 +4,7 @@ import { useIntl } from "react-intl" import { BookingStatusEnum } from "@/constants/booking" import { customerService } from "@/constants/currentWebHrefs" +import { preliminaryReceipt } from "@/constants/routes/myStay" import AddToCalendar from "@/components/HotelReservation/AddToCalendar" import { generateDateTime } from "@/components/HotelReservation/BookingConfirmation/Header/Actions/helpers" @@ -128,15 +129,16 @@ export default function ActionPanel({ hotelName={hotel.name} renderButton={(onPress) => } /> - + {showCancelStayButton && (