- {room.roomType}
+ {roomType}
{intl.formatMessage(
{ id: "{amount} {currency}" },
{
- amount: intl.formatNumber(room.roomPrice.local.price),
- currency: room.roomPrice.local.currency,
+ amount: intl.formatNumber(roomPrice.local.price),
+ currency: roomPrice.local.currency,
}
)}
@@ -82,20 +116,18 @@ export default function Summary({
{intl.formatMessage(
{ id: "booking.adults" },
- { totalAdults: room.adults }
+ { totalAdults: adults }
)}
- {room.children?.length ? (
+ {children?.length ? (
{intl.formatMessage(
{ id: "booking.children" },
- { totalChildren: room.children.length }
+ { totalChildren: children.length }
)}
) : null}
-
- {room.cancellationText}
-
+
{cancellationText}
- {room.packages
- ? room.packages.map((roomPackage) => (
+ {packages
+ ? packages.map((roomPackage) => (
@@ -147,7 +179,7 @@ export default function Summary({
{intl.formatMessage(
{ id: "{amount} {currency}" },
- { amount: "0", currency: room.roomPrice.local.currency }
+ { amount: "0", currency: roomPrice.local.currency }
)}
@@ -161,7 +193,7 @@ export default function Summary({
{intl.formatMessage(
{ id: "{amount} {currency}" },
- { amount: "0", currency: room.roomPrice.local.currency }
+ { amount: "0", currency: roomPrice.local.currency }
)}
diff --git a/components/HotelReservation/Summary/summary.module.css b/components/HotelReservation/EnterDetails/Summary/UI/ui.module.css
similarity index 100%
rename from components/HotelReservation/Summary/summary.module.css
rename to components/HotelReservation/EnterDetails/Summary/UI/ui.module.css
diff --git a/components/HotelReservation/EnterDetails/Summary/index.tsx b/components/HotelReservation/EnterDetails/Summary/index.tsx
deleted file mode 100644
index a649788ea..000000000
--- a/components/HotelReservation/EnterDetails/Summary/index.tsx
+++ /dev/null
@@ -1,57 +0,0 @@
-import { redirect } from "next/navigation"
-
-import { selectRate } from "@/constants/routes/hotelReservation"
-import {
- getProfileSafely,
- getSelectedRoomAvailability,
-} from "@/lib/trpc/memoizedRequests"
-
-import { generateChildrenString } from "@/components/HotelReservation/SelectRate/RoomSelection/utils"
-import { getLang } from "@/i18n/serverContext"
-
-import ClientSummary from "./Client"
-
-import type { SummaryPageProps } from "@/types/components/hotelReservation/summary"
-
-export default async function Summary({
- adults,
- fromDate,
- hotelId,
- kids,
- packageCodes,
- rateCode,
- roomTypeCode,
- toDate,
-}: SummaryPageProps) {
- const lang = getLang()
-
- const availability = await getSelectedRoomAvailability({
- adults,
- children: kids ? generateChildrenString(kids) : undefined,
- hotelId,
- packageCodes,
- rateCode,
- roomStayStartDate: fromDate,
- roomStayEndDate: toDate,
- roomTypeCode,
- })
- const user = await getProfileSafely()
-
- if (!availability || !availability.selectedRoom) {
- console.error("No hotel or availability data", availability)
- // TODO: handle this case
- redirect(selectRate(lang))
- }
-
- return (
-
- )
-}
diff --git a/components/HotelReservation/SidePanel/index.tsx b/components/HotelReservation/SidePanel/index.tsx
new file mode 100644
index 000000000..d4a10c37f
--- /dev/null
+++ b/components/HotelReservation/SidePanel/index.tsx
@@ -0,0 +1,19 @@
+import { sidePanelVariants } from "./variants"
+
+import styles from "./sidePanel.module.css"
+
+import type { SidePanelProps } from "@/types/components/hotelReservation/sidePanel"
+
+export default function SidePanel({
+ children,
+ variant,
+}: React.PropsWithChildren
) {
+ const classNames = sidePanelVariants({ variant })
+ return (
+
+ )
+}
diff --git a/components/HotelReservation/EnterDetails/Summary/summary.module.css b/components/HotelReservation/SidePanel/sidePanel.module.css
similarity index 71%
rename from components/HotelReservation/EnterDetails/Summary/summary.module.css
rename to components/HotelReservation/SidePanel/sidePanel.module.css
index 5cc412082..6485aa89d 100644
--- a/components/HotelReservation/EnterDetails/Summary/summary.module.css
+++ b/components/HotelReservation/SidePanel/sidePanel.module.css
@@ -1,68 +1,62 @@
-.mobileSummary {
- display: block;
-}
-
-.desktopSummary {
- display: none;
-}
-
-.summary {
- background-color: var(--Main-Grey-White);
-
- border-color: var(--Primary-Light-On-Surface-Divider-subtle);
- border-style: solid;
- border-width: 1px;
- border-bottom: none;
- z-index: 10;
-}
-
-.hider {
- display: none;
-}
-
+.sidePanel,
+.hider,
.shadow {
display: none;
}
@media screen and (min-width: 1367px) {
- .mobileSummary {
- display: none;
- }
-
- .desktopSummary {
+ .sidePanel {
display: grid;
grid-template-rows: auto auto 1fr;
- margin-top: calc(0px - var(--Spacing-x9));
}
.summary {
+ margin-top: calc(0px - var(--Spacing-x9));
+ }
+
+ .hider {
+ display: block;
+ position: sticky;
+ }
+
+ .receipt .hider {
+ background-color: var(--Main-Grey-White);
+ height: 150px;
+ margin-top: -78px;
+ top: -40px;
+ }
+
+ .summary .hider {
+ background-color: var(--Scandic-Brand-Warm-White);
+ height: 40px;
+ margin-top: var(--Spacing-x4);
+ top: calc(var(--booking-widget-desktop-height) - 6px);
+ }
+
+ .wrapper {
+ background-color: var(--Main-Grey-White);
+ border-color: var(--Primary-Light-On-Surface-Divider-subtle);
+ border-radius: var(--Corner-radius-Large) var(--Corner-radius-Large) 0 0;
+ border-style: solid;
+ border-width: 1px;
+ border-bottom: none;
+ margin-top: calc(0px - var(--Spacing-x9));
position: sticky;
top: calc(
var(--booking-widget-desktop-height) + var(--Spacing-x2) +
var(--Spacing-x-half)
);
z-index: 9;
- border-radius: var(--Corner-radius-Large) var(--Corner-radius-Large) 0 0;
- margin-top: calc(0px - var(--Spacing-x9));
}
.shadow {
- display: block;
background-color: var(--Main-Grey-White);
border-color: var(--Primary-Light-On-Surface-Divider-subtle);
- border-style: solid;
border-left-width: 1px;
border-right-width: 1px;
- border-top: none;
+ border-style: solid;
border-bottom: none;
- }
-
- .hider {
+ border-top: none;
display: block;
- background-color: var(--Scandic-Brand-Warm-White);
- position: sticky;
- top: calc(var(--booking-widget-desktop-height) - 6px);
- margin-top: var(--Spacing-x4);
- height: 40px;
}
}
diff --git a/components/HotelReservation/SidePanel/variants.ts b/components/HotelReservation/SidePanel/variants.ts
new file mode 100644
index 000000000..a6a3a3825
--- /dev/null
+++ b/components/HotelReservation/SidePanel/variants.ts
@@ -0,0 +1,15 @@
+import { cva } from "class-variance-authority"
+
+import styles from "./sidePanel.module.css"
+
+export const sidePanelVariants = cva(styles.sidePanel, {
+ variants: {
+ variant: {
+ receipt: styles.receipt,
+ summary: styles.summary,
+ },
+ },
+ defaultVariants: {
+ variant: "summary",
+ },
+})
diff --git a/components/TempDesignSystem/Link/link.module.css b/components/TempDesignSystem/Link/link.module.css
index 3a997bddb..da8dc802a 100644
--- a/components/TempDesignSystem/Link/link.module.css
+++ b/components/TempDesignSystem/Link/link.module.css
@@ -16,7 +16,8 @@
.breadcrumb {
font-family: var(--typography-Footnote-Bold-fontFamily);
font-size: var(--typography-Footnote-Bold-fontSize);
- font-weight: 500; /* var(--typography-Footnote-Bold-fontWeight); */
+ font-weight: 500;
+ /* var(--typography-Footnote-Bold-fontWeight); */
letter-spacing: var(--typography-Footnote-Bold-letterSpacing);
line-height: var(--typography-Footnote-Bold-lineHeight);
}
@@ -24,7 +25,8 @@
.link.breadcrumb {
font-family: var(--typography-Footnote-Bold-fontFamily);
font-size: var(--typography-Footnote-Bold-fontSize);
- font-weight: 500; /* var(--typography-Footnote-Bold-fontWeight); */
+ font-weight: 500;
+ /* var(--typography-Footnote-Bold-fontWeight); */
letter-spacing: var(--typography-Footnote-Bold-letterSpacing);
line-height: var(--typography-Footnote-Bold-lineHeight);
}
@@ -159,12 +161,15 @@
color: var(--Scandic-Peach-50);
}
-.peach80 {
+.peach80,
+.baseTextMediumContrast {
color: var(--Base-Text-Medium-contrast);
}
.peach80:hover,
-.peach80:active {
+.peach80:active,
+.baseTextMediumContrast:hover,
+.baseTextMediumContrast:active {
color: var(--Base-Text-High-contrast);
}
@@ -235,6 +240,7 @@
letter-spacing: var(--typography-Caption-Bold-letterSpacing);
line-height: var(--typography-Caption-Bold-lineHeight);
}
+
.bold {
font-family: var(--typography-Body-Bold-fontFamily);
font-size: var(--typography-Body-Bold-fontSize);
diff --git a/components/TempDesignSystem/Link/variants.ts b/components/TempDesignSystem/Link/variants.ts
index 0a0c1dd6d..c93b93189 100644
--- a/components/TempDesignSystem/Link/variants.ts
+++ b/components/TempDesignSystem/Link/variants.ts
@@ -9,6 +9,7 @@ export const linkVariants = cva(styles.link, {
},
color: {
baseButtonTextOnFillNormal: styles.baseButtonTextOnFillNormal,
+ baseTextMediumContrast: styles.baseTextMediumContrast,
black: styles.black,
burgundy: styles.burgundy,
none: "",
diff --git a/components/TempDesignSystem/Text/Subtitle/subtitle.module.css b/components/TempDesignSystem/Text/Subtitle/subtitle.module.css
index b15623491..501d614e8 100644
--- a/components/TempDesignSystem/Text/Subtitle/subtitle.module.css
+++ b/components/TempDesignSystem/Text/Subtitle/subtitle.module.css
@@ -86,3 +86,7 @@
.baseTextDisabled {
color: var(--Base-Text-Disabled);
}
+
+.mainGrey60 {
+ color: var(--Main-Grey-60);
+}
diff --git a/components/TempDesignSystem/Text/Subtitle/variants.ts b/components/TempDesignSystem/Text/Subtitle/variants.ts
index f2edbb9f5..bb29cd922 100644
--- a/components/TempDesignSystem/Text/Subtitle/variants.ts
+++ b/components/TempDesignSystem/Text/Subtitle/variants.ts
@@ -14,6 +14,7 @@ const config = {
uiTextMediumContrast: styles.uiTextMediumContrast,
uiTextPlaceholder: styles.uiTextPlaceholder,
red: styles.red,
+ mainGrey60: styles.mainGrey60,
},
textAlign: {
center: styles.center,
diff --git a/components/TempDesignSystem/Toasts/index.tsx b/components/TempDesignSystem/Toasts/index.tsx
index 407eef5a1..899b97672 100644
--- a/components/TempDesignSystem/Toasts/index.tsx
+++ b/components/TempDesignSystem/Toasts/index.tsx
@@ -32,7 +32,7 @@ function getIcon(variant: ToastsProps["variant"]) {
}
}
-export function Toast({ message, onClose, variant }: ToastsProps) {
+export function Toast({ children, message, onClose, variant }: ToastsProps) {
const className = toastVariants({ variant })
const Icon = getIcon(variant)
return (
@@ -40,10 +40,16 @@ export function Toast({ message, onClose, variant }: ToastsProps) {
{Icon && }
- {message}
-
+ {message ? (
+ {message}
+ ) : (
+ {children}
+ )}
+ {onClose ? (
+
+ ) : null}
)
}
diff --git a/components/TempDesignSystem/Toasts/toasts.module.css b/components/TempDesignSystem/Toasts/toasts.module.css
index d49b8d57e..e5f811cb4 100644
--- a/components/TempDesignSystem/Toasts/toasts.module.css
+++ b/components/TempDesignSystem/Toasts/toasts.module.css
@@ -8,6 +8,11 @@
align-items: center;
}
+.content {
+ padding: var(--Spacing-x-one-and-half) var(--Spacing-x3)
+ var(--Spacing-x-one-and-half) var(--Spacing-x2);
+}
+
@media screen and (min-width: 768px) {
.toast {
width: var(--width);
diff --git a/components/TempDesignSystem/Toasts/toasts.ts b/components/TempDesignSystem/Toasts/toasts.ts
index 573f50a1f..1bf37d114 100644
--- a/components/TempDesignSystem/Toasts/toasts.ts
+++ b/components/TempDesignSystem/Toasts/toasts.ts
@@ -2,9 +2,16 @@ import { toastVariants } from "./variants"
import type { VariantProps } from "class-variance-authority"
-export interface ToastsProps
- extends Omit