feat(SW-467): add routing for details steps

This commit is contained in:
Christel Westerberg
2024-10-03 11:39:35 +02:00
parent 00ad62d3a1
commit 1bb2d3f687
5 changed files with 148 additions and 4 deletions

View File

@@ -0,0 +1,25 @@
.page {
min-height: 100dvh;
padding-top: var(--Spacing-x6);
padding-left: var(--Spacing-x2);
padding-right: var(--Spacing-x2);
background-color: var(--Scandic-Brand-Warm-White);
}
.content {
max-width: 1134px;
margin-top: var(--Spacing-x5);
margin-left: auto;
margin-right: auto;
display: flex;
justify-content: space-between;
gap: var(--Spacing-x7);
}
.main {
flex-grow: 1;
}
.summary {
max-width: 340px;
}

View File

@@ -0,0 +1,89 @@
"use client"
import { notFound } from "next/navigation"
import { useIntl } from "react-intl"
import Summary from "@/components/HotelReservation/SelectRate/Summary"
import styles from "./page.module.css"
import { LangParams, PageArgs } from "@/types/params"
// const bedAlternatives = [
// {
// value: "queen",
// name: "Queen bed",
// payment: "160 cm",
// pricePerNight: 0,
// membersPricePerNight: 0,
// currency: "SEK",
// },
// {
// value: "king",
// name: "King bed",
// payment: "160 cm",
// pricePerNight: 0,
// membersPricePerNight: 0,
// currency: "SEK",
// },
// {
// value: "twin",
// name: "Twin bed",
// payment: "90 cm + 90 cm",
// pricePerNight: 82,
// membersPricePerNight: 67,
// currency: "SEK",
// },
// ]
// const breakfastAlternatives = [
// {
// value: "no",
// name: "No breakfast",
// payment: "Always cheeper to get it online",
// pricePerNight: 0,
// currency: "SEK",
// },
// {
// value: "buffe",
// name: "Breakfast buffé",
// payment: "Always cheeper to get it online",
// pricePerNight: 150,
// currency: "SEK",
// },
// ]
enum StepEnum {
"select-bed" = "select-bed",
breakfast = "breakfast",
details = "details",
payment = "payment",
}
type Step = keyof typeof StepEnum
function isValidStep(step: string): step is Step {
return Object.keys(StepEnum).includes(step)
}
export default function StepPage({
params,
}: PageArgs<LangParams & { step: string }>) {
const { step } = params
const intl = useIntl()
if (isValidStep(step)) {
return notFound()
}
switch (step) {
case StepEnum.breakfast:
return <div>Select BREAKFAST</div>
case StepEnum.details:
return <div>Select DETAILS</div>
case StepEnum.payment:
return <div>Select PAYMENT</div>
case StepEnum["select-bed"]:
return <div>Select BED</div>
}
}