From 103dcc7f1ef305b84f9cc390db39df6c643bf746 Mon Sep 17 00:00:00 2001 From: Arvid Norlin Date: Mon, 14 Oct 2024 15:36:42 +0200 Subject: [PATCH] feat(SW-472): Add EnterDetails SidePeek --- .../hotelreservation/[step]/layout.tsx | 2 + .../(public)/hotelreservation/[step]/page.tsx | 62 ++++++++++--------- .../{ReadMore => }/Contact/contact.module.css | 4 +- .../{ReadMore => }/Contact/index.tsx | 19 ++++-- .../SidePeek/enterDetailsSidePeek.module.css | 11 ++++ .../EnterDetails/SidePeek/index.tsx | 42 +++++++++++++ .../EnterDetails/Summary/ToggleSidePeek.tsx | 35 +++++++++++ .../EnterDetails/Summary/index.tsx | 21 ++----- .../hotelDetailSidePeek.module.css | 4 -- .../HotelDetailSidePeek/index.tsx | 58 ----------------- .../HotelSelectionHeader/index.tsx | 3 - .../HotelReservation/ReadMore/index.tsx | 2 +- i18n/dictionaries/da.json | 5 ++ i18n/dictionaries/de.json | 7 ++- i18n/dictionaries/en.json | 7 ++- i18n/dictionaries/fi.json | 7 ++- i18n/dictionaries/no.json | 7 ++- i18n/dictionaries/sv.json | 5 ++ stores/enter-details.ts | 7 +++ types/components/enterDetails/sidePeek.ts | 9 +++ 20 files changed, 194 insertions(+), 123 deletions(-) rename components/HotelReservation/{ReadMore => }/Contact/contact.module.css (93%) rename components/HotelReservation/{ReadMore => }/Contact/index.tsx (83%) create mode 100644 components/HotelReservation/EnterDetails/SidePeek/enterDetailsSidePeek.module.css create mode 100644 components/HotelReservation/EnterDetails/SidePeek/index.tsx create mode 100644 components/HotelReservation/EnterDetails/Summary/ToggleSidePeek.tsx delete mode 100644 components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/hotelDetailSidePeek.module.css delete mode 100644 components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/index.tsx create mode 100644 types/components/enterDetails/sidePeek.ts diff --git a/app/[lang]/(live)/(public)/hotelreservation/[step]/layout.tsx b/app/[lang]/(live)/(public)/hotelreservation/[step]/layout.tsx index 0e075b594..5f62c69c9 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/[step]/layout.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/[step]/layout.tsx @@ -4,6 +4,7 @@ import { serverClient } from "@/lib/trpc/server" import EnterDetailsProvider from "@/components/HotelReservation/EnterDetails/Provider" import SelectedRoom from "@/components/HotelReservation/EnterDetails/SelectedRoom" +import SidePeek from "@/components/HotelReservation/EnterDetails/SidePeek" import Summary from "@/components/HotelReservation/EnterDetails/Summary" import HotelSelectionHeader from "@/components/HotelReservation/HotelSelectionHeader" import { setLang } from "@/i18n/serverContext" @@ -38,6 +39,7 @@ export default async function StepLayout({ + ) diff --git a/app/[lang]/(live)/(public)/hotelreservation/[step]/page.tsx b/app/[lang]/(live)/(public)/hotelreservation/[step]/page.tsx index 8718c8db7..3cbbcdafb 100644 --- a/app/[lang]/(live)/(public)/hotelreservation/[step]/page.tsx +++ b/app/[lang]/(live)/(public)/hotelreservation/[step]/page.tsx @@ -36,35 +36,37 @@ export default async function StepPage({ } return ( -
- - - - - - - -
- - - - -
+ <> +
+ + + + + + + +
+ + + + +
+ ) } diff --git a/components/HotelReservation/ReadMore/Contact/contact.module.css b/components/HotelReservation/Contact/contact.module.css similarity index 93% rename from components/HotelReservation/ReadMore/Contact/contact.module.css rename to components/HotelReservation/Contact/contact.module.css index 53f6e01f3..768e01ca2 100644 --- a/components/HotelReservation/ReadMore/Contact/contact.module.css +++ b/components/HotelReservation/Contact/contact.module.css @@ -32,8 +32,8 @@ } .ecoLabel { - display: grid; - grid-template-columns: auto 1fr; + display: flex; + align-items: center; column-gap: var(--Spacing-x-one-and-half); grid-column: 2 / 3; grid-row: 3 / 4; diff --git a/components/HotelReservation/ReadMore/Contact/index.tsx b/components/HotelReservation/Contact/index.tsx similarity index 83% rename from components/HotelReservation/ReadMore/Contact/index.tsx rename to components/HotelReservation/Contact/index.tsx index 46491fb3d..bcdaeb756 100644 --- a/components/HotelReservation/ReadMore/Contact/index.tsx +++ b/components/HotelReservation/Contact/index.tsx @@ -24,20 +24,26 @@ export default function Contact({ hotel }: ContactProps) { {intl.formatMessage({ id: "Address" })} - {hotel.address.streetAddress} - {hotel.address.city} + + {`${hotel.address.streetAddress}, ${hotel.address.city}`} +
  • {intl.formatMessage({ id: "Driving directions" })} - {intl.formatMessage({ id: "Google Maps" })} + + {intl.formatMessage({ id: "Google Maps" })} +
  • {intl.formatMessage({ id: "Email" })} - + {hotel.contactInformation.email}
  • @@ -45,7 +51,10 @@ export default function Contact({ hotel }: ContactProps) { {intl.formatMessage({ id: "Contact us" })} - + {hotel.contactInformation.phoneNumber} diff --git a/components/HotelReservation/EnterDetails/SidePeek/enterDetailsSidePeek.module.css b/components/HotelReservation/EnterDetails/SidePeek/enterDetailsSidePeek.module.css new file mode 100644 index 000000000..5e619bd69 --- /dev/null +++ b/components/HotelReservation/EnterDetails/SidePeek/enterDetailsSidePeek.module.css @@ -0,0 +1,11 @@ +.article { + display: flex; + flex-direction: column; + gap: var(--Spacing-x2); +} + +.section { + display: flex; + flex-direction: column; + gap: var(--Spacing-x2); +} diff --git a/components/HotelReservation/EnterDetails/SidePeek/index.tsx b/components/HotelReservation/EnterDetails/SidePeek/index.tsx new file mode 100644 index 000000000..272683732 --- /dev/null +++ b/components/HotelReservation/EnterDetails/SidePeek/index.tsx @@ -0,0 +1,42 @@ +"use client" + +import { useIntl } from "react-intl" + +import { useEnterDetailsStore } from "@/stores/enter-details" + +import Contact from "@/components/HotelReservation/Contact" +import Divider from "@/components/TempDesignSystem/Divider" +import SidePeek from "@/components/TempDesignSystem/SidePeek" +import Body from "@/components/TempDesignSystem/Text/Body" + +import styles from "./enterDetailsSidePeek.module.css" + +import { + SidePeekEnum, + SidePeekProps, +} from "@/types/components/enterDetails/sidePeek" + +export default function EnterDetailsSidePeek({ hotel }: SidePeekProps) { + const activeSidePeek = useEnterDetailsStore((state) => state.activeSidePeek) + const close = useEnterDetailsStore((state) => state.closeSidePeek) + + const intl = useIntl() + return ( + +
    + + +
    + {hotel.hotelContent.texts.descriptions.medium} + + {hotel.hotelContent.texts.facilityInformation} +
    +
    +
    + ) +} diff --git a/components/HotelReservation/EnterDetails/Summary/ToggleSidePeek.tsx b/components/HotelReservation/EnterDetails/Summary/ToggleSidePeek.tsx new file mode 100644 index 000000000..2f022f857 --- /dev/null +++ b/components/HotelReservation/EnterDetails/Summary/ToggleSidePeek.tsx @@ -0,0 +1,35 @@ +"use client" + +import { useIntl } from "react-intl" + +import { useEnterDetailsStore } from "@/stores/enter-details" + +import { ChevronRightSmallIcon } from "@/components/Icons" +import Button from "@/components/TempDesignSystem/Button" + +import { SidePeekEnum } from "@/types/components/enterDetails/sidePeek" + +export default function ToggleSidePeek() { + const intl = useIntl() + const openSidePeek = useEnterDetailsStore((state) => state.openSidePeek) + + return ( + + ) +} diff --git a/components/HotelReservation/EnterDetails/Summary/index.tsx b/components/HotelReservation/EnterDetails/Summary/index.tsx index 8efc418a1..18121dad3 100644 --- a/components/HotelReservation/EnterDetails/Summary/index.tsx +++ b/components/HotelReservation/EnterDetails/Summary/index.tsx @@ -1,13 +1,14 @@ import { dt } from "@/lib/dt" -import { ArrowRightIcon, ChevronRightSmallIcon } from "@/components/Icons" +import { ArrowRightIcon } from "@/components/Icons" import Divider from "@/components/TempDesignSystem/Divider" -import Link from "@/components/TempDesignSystem/Link" import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" import { getIntl } from "@/i18n" import { getLang } from "@/i18n/serverContext" +import ToggleSidePeek from "./ToggleSidePeek" + import styles from "./summary.module.css" // TEMP @@ -21,7 +22,6 @@ const rooms = [ export default async function Summary() { const intl = await getIntl() const lang = getLang() - const fromDate = dt().locale(lang).format("ddd, D MMM") const toDate = dt().add(1, "day").locale(lang).format("ddd, D MMM") const diff = dt(toDate).diff(fromDate, "days") @@ -75,19 +75,8 @@ export default async function Summary() { {toDate} - - {intl.formatMessage({ id: "See room details" })} - - + +
    diff --git a/components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/hotelDetailSidePeek.module.css b/components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/hotelDetailSidePeek.module.css deleted file mode 100644 index fb400465e..000000000 --- a/components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/hotelDetailSidePeek.module.css +++ /dev/null @@ -1,4 +0,0 @@ -.buttons { - display: flex; - gap: var(--Spacing-x3); -} diff --git a/components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/index.tsx b/components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/index.tsx deleted file mode 100644 index d4e3eb829..000000000 --- a/components/HotelReservation/HotelSelectionHeader/HotelDetailSidePeek/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -"use client" - -import { useState } from "react" -import { useIntl } from "react-intl" - -import ChevronRightSmallIcon from "@/components/Icons/ChevronRightSmall" -import Button from "@/components/TempDesignSystem/Button" -import SidePeek from "@/components/TempDesignSystem/SidePeek" - -import styles from "./hotelDetailSidePeek.module.css" - -export default function HotelDetailSidePeek() { - const intl = useIntl() - const [isOpen, setIsOpen] = useState(false) - - function toggleSidePeek() { - setIsOpen(!isOpen) - } - - return ( - <> -
    - - -
    - setIsOpen(false)} - > -
    TBD
    -
    - - ) -} diff --git a/components/HotelReservation/HotelSelectionHeader/index.tsx b/components/HotelReservation/HotelSelectionHeader/index.tsx index 222dceda1..69b4134eb 100644 --- a/components/HotelReservation/HotelSelectionHeader/index.tsx +++ b/components/HotelReservation/HotelSelectionHeader/index.tsx @@ -6,8 +6,6 @@ import Body from "@/components/TempDesignSystem/Text/Body" import Caption from "@/components/TempDesignSystem/Text/Caption" import Title from "@/components/TempDesignSystem/Text/Title" -import HotelDetailSidePeek from "./HotelDetailSidePeek" - import styles from "./hotelSelectionHeader.module.css" import { HotelSelectionHeaderProps } from "@/types/components/hotelReservation/selectRate/hotelSelectionHeader" @@ -46,7 +44,6 @@ export default function HotelSelectionHeader({ {hotel.hotelContent.texts.descriptions.short} -
    diff --git a/components/HotelReservation/ReadMore/index.tsx b/components/HotelReservation/ReadMore/index.tsx index e988ec40d..5814eae54 100644 --- a/components/HotelReservation/ReadMore/index.tsx +++ b/components/HotelReservation/ReadMore/index.tsx @@ -11,7 +11,7 @@ import SidePeek from "@/components/TempDesignSystem/SidePeek" import Body from "@/components/TempDesignSystem/Text/Body" import Subtitle from "@/components/TempDesignSystem/Text/Subtitle" -import Contact from "./Contact" +import Contact from "../Contact" import styles from "./readMore.module.css" diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index 2347bd764..b5e839d9c 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -4,6 +4,7 @@ "A destination or hotel name is needed to be able to search for a hotel room.": "Et destinations- eller hotelnavn er nødvendigt for at kunne søge efter et hotelværelse.", "A photo of the room": "Et foto af værelset", "About meetings & conferences": "About meetings & conferences", + "About the hotel": "About the hotel", "Activities": "Aktiviteter", "Add code": "Tilføj kode", "Add new card": "Tilføj nyt kort", @@ -86,6 +87,7 @@ "Do you want to start the day with Scandics famous breakfast buffé?": "Vil du starte dagen med Scandics berømte morgenbuffet?", "Done": "Færdig", "Download the Scandic app": "Download Scandic-appen", + "Driving directions": "Kørselsanvisning", "Earn bonus nights & points": "Optjen bonusnætter og point", "Edit": "Redigere", "Edit profile": "Rediger profil", @@ -105,6 +107,7 @@ "Find hotels": "Find hotel", "Firstname": "Fornavn", "Flexibility": "Fleksibilitet", + "Follow us": "Følg os", "Former Scandic Hotel": "Tidligere Scandic Hotel", "Free cancellation": "Gratis afbestilling", "Free rebooking": "Gratis ombooking", @@ -113,6 +116,7 @@ "Get member benefits & offers": "Få medlemsfordele og tilbud", "Go back to edit": "Gå tilbage til redigering", "Go back to overview": "Gå tilbage til oversigten", + "Google Maps": "Google Maps", "Guest information": "Gæsteinformation", "Guests & Rooms": "Gæster & værelser", "Hi": "Hei", @@ -188,6 +192,7 @@ "No, keep card": "Nej, behold kortet", "Non refundable": "Ikke-refunderbart", "Non-refundable": "Ikke-refunderbart", + "Nordic Swan Ecolabel": "Svanemærket", "Not found": "Ikke fundet", "Nr night, nr adult": "{nights, number} nat, {adults, number} voksen", "On your journey": "På din rejse", diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 16e61ed3c..5fecef276 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -4,6 +4,7 @@ "A destination or hotel name is needed to be able to search for a hotel room.": "Ein Reiseziel oder Hotelname wird benötigt, um nach einem Hotelzimmer suchen zu können.", "A photo of the room": "Ein Foto des Zimmers", "About meetings & conferences": "About meetings & conferences", + "About the hotel": "Über das Hotel", "Activities": "Aktivitäten", "Add code": "Code hinzufügen", "Add new card": "Neue Karte hinzufügen", @@ -86,6 +87,7 @@ "Do you want to start the day with Scandics famous breakfast buffé?": "Möchten Sie den Tag mit Scandics berühmtem Frühstücksbuffet beginnen?", "Done": "Fertig", "Download the Scandic app": "Laden Sie die Scandic-App herunter", + "Driving directions": "Anfahrtsbeschreibung", "Earn bonus nights & points": "Sammeln Sie Bonusnächte und -punkte", "Edit": "Bearbeiten", "Edit profile": "Profil bearbeiten", @@ -105,6 +107,7 @@ "Find hotels": "Hotels finden", "Firstname": "Vorname", "Flexibility": "Flexibilität", + "Follow us": "Folgen Sie uns", "Former Scandic Hotel": "Ehemaliges Scandic Hotel", "Free cancellation": "Kostenlose Stornierung", "Free rebooking": "Kostenlose Umbuchung", @@ -113,6 +116,7 @@ "Get member benefits & offers": "Holen Sie sich Vorteile und Angebote für Mitglieder", "Go back to edit": "Zurück zum Bearbeiten", "Go back to overview": "Zurück zur Übersicht", + "Google Maps": "Google Maps", "Guest information": "Informationen für Gäste", "Guests & Rooms": "Gäste & Zimmer", "Hi": "Hallo", @@ -188,6 +192,7 @@ "No, keep card": "Nein, Karte behalten", "Non refundable": "Nicht erstattungsfähig", "Non-refundable": "Nicht erstattungsfähig", + "Nordic Swan Ecolabel": "Nordic Swan Ecolabel", "Not found": "Nicht gefunden", "Nr night, nr adult": "{nights, number} Nacht, {adults, number} Erwachsener", "On your journey": "Auf deiner Reise", @@ -354,4 +359,4 @@ "{amount} {currency}": "{amount} {currency}", "{difference}{amount} {currency}": "{difference}{amount} {currency}", "{width} cm × {length} cm": "{width} cm × {length} cm" -} \ No newline at end of file +} diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index 9655dc962..84a76922f 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -4,6 +4,7 @@ "A destination or hotel name is needed to be able to search for a hotel room.": "A destination or hotel name is needed to be able to search for a hotel room.", "A photo of the room": "A photo of the room", "About meetings & conferences": "About meetings & conferences", + "About the hotel": "About the hotel", "Activities": "Activities", "Add code": "Add code", "Add new card": "Add new card", @@ -89,6 +90,7 @@ "Do you want to start the day with Scandics famous breakfast buffé?": "Do you want to start the day with Scandics famous breakfast buffé?", "Done": "Done", "Download the Scandic app": "Download the Scandic app", + "Driving directions": "Driving directions", "Earn bonus nights & points": "Earn bonus nights & points", "Edit": "Edit", "Edit profile": "Edit profile", @@ -108,6 +110,7 @@ "Find hotels": "Find hotels", "Firstname": "Firstname", "Flexibility": "Flexibility", + "Follow us": "Follow us", "Former Scandic Hotel": "Former Scandic Hotel", "Free cancellation": "Free cancellation", "Free rebooking": "Free rebooking", @@ -116,6 +119,7 @@ "Get member benefits & offers": "Get member benefits & offers", "Go back to edit": "Go back to edit", "Go back to overview": "Go back to overview", + "Google Maps": "Google Maps", "Guest information": "Guest information", "Guests & Rooms": "Guests & Rooms", "Hi": "Hi", @@ -191,6 +195,7 @@ "No, keep card": "No, keep card", "Non refundable": "Non refundable", "Non-refundable": "Non-refundable", + "Nordic Swan Ecolabel": "Nordic Swan Ecolabel", "Not found": "Not found", "Nr night, nr adult": "{nights, number} night, {adults, number} adult", "On your journey": "On your journey", @@ -357,4 +362,4 @@ "{amount} {currency}": "{amount} {currency}", "{difference}{amount} {currency}": "{difference}{amount} {currency}", "{width} cm × {length} cm": "{width} cm × {length} cm" -} \ No newline at end of file +} diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index c4d20acf3..fd1c9e57d 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -4,6 +4,7 @@ "A destination or hotel name is needed to be able to search for a hotel room.": "Kohteen tai hotellin nimi tarvitaan, jotta hotellihuonetta voidaan hakea.", "A photo of the room": "Kuva huoneesta", "About meetings & conferences": "About meetings & conferences", + "About the hotel": "Tietoja hotellista", "Activities": "Aktiviteetit", "Add code": "Lisää koodi", "Add new card": "Lisää uusi kortti", @@ -86,6 +87,7 @@ "Do you want to start the day with Scandics famous breakfast buffé?": "Haluatko aloittaa päiväsi Scandicsin kuuluisalla aamiaisbuffella?", "Done": "Valmis", "Download the Scandic app": "Lataa Scandic-sovellus", + "Driving directions": "Ajo-ohjeet", "Earn bonus nights & points": "Ansaitse bonusöitä ja -pisteitä", "Edit": "Muokata", "Edit profile": "Muokkaa profiilia", @@ -105,6 +107,7 @@ "Find hotels": "Etsi hotelleja", "Firstname": "Etunimi", "Flexibility": "Joustavuus", + "Follow us": "Seuraa meitä", "Former Scandic Hotel": "Entinen Scandic-hotelli", "Free cancellation": "Ilmainen peruutus", "Free rebooking": "Ilmainen uudelleenvaraus", @@ -113,6 +116,7 @@ "Get member benefits & offers": "Hanki jäsenetuja ja -tarjouksia", "Go back to edit": "Palaa muokkaamaan", "Go back to overview": "Palaa yleiskatsaukseen", + "Google Maps": "Google Maps", "Guest information": "Vieraan tiedot", "Guests & Rooms": "Vieraat & Huoneet", "Hi": "Hi", @@ -188,6 +192,7 @@ "No, keep card": "Ei, pidä kortti", "Non refundable": "Ei palautettavissa", "Non-refundable": "Ei palautettavissa", + "Nordic Swan Ecolabel": "Ympäristömerkki Miljömärkt", "Not found": "Ei löydetty", "Nr night, nr adult": "{nights, number} yö, {adults, number} aikuinen", "On your journey": "Matkallasi", @@ -355,4 +360,4 @@ "{amount} {currency}": "{amount} {currency}", "{difference}{amount} {currency}": "{difference}{amount} {currency}", "{width} cm × {length} cm": "{width} cm × {length} cm" -} \ No newline at end of file +} diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index 69ead0f59..20bbcc37d 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -4,6 +4,7 @@ "A destination or hotel name is needed to be able to search for a hotel room.": "Et reisemål eller hotellnavn er nødvendig for å kunne søke etter et hotellrom.", "A photo of the room": "Et bilde av rommet", "About meetings & conferences": "About meetings & conferences", + "About the hotel": "Om hotellet", "Activities": "Aktiviteter", "Add code": "Legg til kode", "Add new card": "Legg til nytt kort", @@ -85,6 +86,7 @@ "Do you want to start the day with Scandics famous breakfast buffé?": "Vil du starte dagen med Scandics berømte frokostbuffé?", "Done": "Ferdig", "Download the Scandic app": "Last ned Scandic-appen", + "Driving directions": "Veibeskrivelser", "Earn bonus nights & points": "Tjen bonusnetter og poeng", "Edit": "Redigere", "Edit profile": "Rediger profil", @@ -104,6 +106,7 @@ "Find hotels": "Finn hotell", "Firstname": "Fornavn", "Flexibility": "Fleksibilitet", + "Follow us": "Følg oss", "Former Scandic Hotel": "Tidligere Scandic-hotell", "Free cancellation": "Gratis avbestilling", "Free rebooking": "Gratis ombooking", @@ -112,6 +115,7 @@ "Get member benefits & offers": "Få medlemsfordeler og tilbud", "Go back to edit": "Gå tilbake til redigering", "Go back to overview": "Gå tilbake til oversikten", + "Google Maps": "Google Maps", "Guest information": "Informasjon til gjester", "Guests & Rooms": "Gjester & rom", "Hi": "Hei", @@ -186,6 +190,7 @@ "No, keep card": "Nei, behold kortet", "Non refundable": "Ikke-refunderbart", "Non-refundable": "Ikke-refunderbart", + "Nordic Swan Ecolabel": "Svanemerket", "Not found": "Ikke funnet", "Nr night, nr adult": "{nights, number} natt, {adults, number} voksen", "On your journey": "På reisen din", @@ -351,4 +356,4 @@ "{amount} {currency}": "{amount} {currency}", "{difference}{amount} {currency}": "{difference}{amount} {currency}", "{width} cm × {length} cm": "{width} cm × {length} cm" -} \ No newline at end of file +} diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index e90cf7b35..7be6d17f1 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -4,6 +4,7 @@ "A destination or hotel name is needed to be able to search for a hotel room.": "Ett destinations- eller hotellnamn behövs för att kunna söka efter ett hotellrum.", "A photo of the room": "Ett foto av rummet", "About meetings & conferences": "About meetings & conferences", + "About the hotel": "Om hotellet", "Activities": "Aktiviteter", "Add code": "Lägg till kod", "Add new card": "Lägg till nytt kort", @@ -85,6 +86,7 @@ "Do you want to start the day with Scandics famous breakfast buffé?": "Vill du starta dagen med Scandics berömda frukostbuffé?", "Done": "Klar", "Download the Scandic app": "Ladda ner Scandic-appen", + "Driving directions": "Vägbeskrivningar", "Earn bonus nights & points": "Tjäna bonusnätter och poäng", "Edit": "Redigera", "Edit profile": "Redigera profil", @@ -104,6 +106,7 @@ "Find hotels": "Hitta hotell", "Firstname": "Förnamn", "Flexibility": "Flexibilitet", + "Follow us": "Följ oss", "Former Scandic Hotel": "Tidigare Scandichotell", "Free cancellation": "Fri avbokning", "Free rebooking": "Fri ombokning", @@ -112,6 +115,7 @@ "Get member benefits & offers": "Ta del av medlemsförmåner och erbjudanden", "Go back to edit": "Gå tillbaka till redigeringen", "Go back to overview": "Gå tillbaka till översikten", + "Google Maps": "Google Maps", "Guest information": "Information till gästerna", "Guests & Rooms": "Gäster & rum", "Hi": "Hej", @@ -186,6 +190,7 @@ "No, keep card": "Nej, behåll kortet", "Non refundable": "Ej återbetalningsbar", "Non-refundable": "Ej återbetalningsbar", + "Nordic Swan Ecolabel": "Svanenmärkt", "Not found": "Hittades inte", "Nr night, nr adult": "{nights, number} natt, {adults, number} vuxen", "On your journey": "På din resa", diff --git a/stores/enter-details.ts b/stores/enter-details.ts index 41d15c3a5..d4803dcb3 100644 --- a/stores/enter-details.ts +++ b/stores/enter-details.ts @@ -7,6 +7,7 @@ import { breakfastSchema } from "@/components/HotelReservation/EnterDetails/Brea import { detailsSchema } from "@/components/HotelReservation/EnterDetails/Details/schema" import { DetailsSchema } from "@/types/components/enterDetails/details" +import { SidePeekEnum } from "@/types/components/enterDetails/sidePeek" import { StepEnum } from "@/types/components/enterDetails/step" import { bedTypeEnum } from "@/types/enums/bedType" import { breakfastEnum } from "@/types/enums/breakfast" @@ -18,9 +19,12 @@ interface EnterDetailsState { } & DetailsSchema steps: StepEnum[] currentStep: StepEnum + activeSidePeek: SidePeekEnum | null isValid: Record completeStep: (updatedData: Partial) => void navigate: (step: StepEnum, searchParams?: Record) => void + openSidePeek: (key: SidePeekEnum.hotelDetails | null) => void + closeSidePeek: () => void } export function initEditDetailsState(currentStep: StepEnum) { @@ -104,7 +108,10 @@ export function initEditDetailsState(currentStep: StepEnum) { window.history.pushState({}, "", step + "?" + query.toString()) }) ), + openSidePeek: (key: SidePeekEnum | null) => set({ activeSidePeek: key }), + closeSidePeek: () => set({ activeSidePeek: null }), currentStep, + activeSidePeek: null, isValid, completeStep: (updatedData) => set( diff --git a/types/components/enterDetails/sidePeek.ts b/types/components/enterDetails/sidePeek.ts new file mode 100644 index 000000000..b109452c6 --- /dev/null +++ b/types/components/enterDetails/sidePeek.ts @@ -0,0 +1,9 @@ +import { Hotel } from "@/types/hotel" + +export enum SidePeekEnum { + hotelDetails = "hotel-detail-side-peek", +} + +export type SidePeekProps = { + hotel: Hotel +}