From a3602b285bf9a04a90bacc71e68c532c5397156f Mon Sep 17 00:00:00 2001 From: Fredrik Thorsson Date: Tue, 13 Aug 2024 09:09:33 +0200 Subject: [PATCH] feat(SW-240): add translations --- .../BookingWidget/bookingWidget.module.css | 36 +++++++++++++------ components/BookingWidget/index.tsx | 20 ++++++++--- components/Current/Header/index.tsx | 2 +- i18n/dictionaries/da.json | 6 +++- i18n/dictionaries/de.json | 6 +++- i18n/dictionaries/en.json | 6 +++- i18n/dictionaries/fi.json | 6 +++- i18n/dictionaries/no.json | 6 +++- i18n/dictionaries/sv.json | 6 +++- 9 files changed, 71 insertions(+), 23 deletions(-) diff --git a/components/BookingWidget/bookingWidget.module.css b/components/BookingWidget/bookingWidget.module.css index 0437c2c48..f642b37aa 100644 --- a/components/BookingWidget/bookingWidget.module.css +++ b/components/BookingWidget/bookingWidget.module.css @@ -1,21 +1,35 @@ .container { - display: none; + border-top: 1px solid var(--Base-Border-Subtle); + /* display: none; */ +} + +.form { + display: flex; + padding: var(--Spacing-x2) var(--Spacing-x5); +} + +.input { + display: flex; + width: 100%; + max-width: 1250px; +} + +.where { + width: 100%; + max-width: 280px; +} + +.when { + width: 100%; + max-width: 240px; } /** * Update the styles after mobile UX is ready */ -@media screen and (min-width: 1367px) { +@media screen and (max-width: 1367px) { .container { - display: grid; - padding: 0 var(--Spacing-x5); - gap: var(--Spacing-x3); - } - .form { - display: grid; - gap: var(--Spacing-x5); - grid-template-columns: repeat(6, auto); - align-items: center; + display: none; } } diff --git a/components/BookingWidget/index.tsx b/components/BookingWidget/index.tsx index c3c32437b..c8d60fe91 100644 --- a/components/BookingWidget/index.tsx +++ b/components/BookingWidget/index.tsx @@ -1,6 +1,7 @@ "use client" import { zodResolver } from "@hookform/resolvers/zod" import { FormProvider, useForm } from "react-hook-form" +import { useIntl } from "react-intl" import { dt } from "@/lib/dt" @@ -12,6 +13,8 @@ import styles from "./bookingWidget.module.css" import { type BookingWidgetSchema } from "@/types/components/bookingWidget" export function BookingWidget() { + const { formatMessage } = useIntl() + const methods = useForm({ defaultValues: { search: { @@ -49,11 +52,18 @@ export function BookingWidget() {
-
Search
-
Nights
-
Rooms
-
Bonus code
-
Bonus cheque or reward nights
+
+
+ {formatMessage({ id: "Where to" })} +
+
{formatMessage({ id: "When" })}
+
+ {formatMessage({ id: "Rooms & Guests" })} +
+
+ {formatMessage({ id: "Booking codes and vouchers" })} +
+
diff --git a/components/Current/Header/index.tsx b/components/Current/Header/index.tsx index 0f932cfc8..e590e3f65 100644 --- a/components/Current/Header/index.tsx +++ b/components/Current/Header/index.tsx @@ -28,7 +28,7 @@ export default async function Header({ /** * ToDo: Create logic to get this info from ContentStack based on page * */ - const hideBookingWidget = true + const hideBookingWidget = false if (!data) { return null diff --git a/i18n/dictionaries/da.json b/i18n/dictionaries/da.json index b1382e9a7..0c767e51d 100644 --- a/i18n/dictionaries/da.json +++ b/i18n/dictionaries/da.json @@ -134,5 +134,9 @@ "Room facilities": "Værelsesfaciliteter", "Hotel facilities": "Hotel faciliteter", "Hotel surroundings": "Hotel omgivelser", - "Show map": "Vis kort" + "Show map": "Vis kort", + "Where to": "Hvorhen", + "When": "Hvornår", + "Rooms & Guests": "Værelser & gæster", + "Booking codes and vouchers": "Bestillingskoder og værdibeviser" } diff --git a/i18n/dictionaries/de.json b/i18n/dictionaries/de.json index 56d36585f..a29347278 100644 --- a/i18n/dictionaries/de.json +++ b/i18n/dictionaries/de.json @@ -128,5 +128,9 @@ "Room facilities": "Zimmerausstattung", "Hotel facilities": "Hotel-Infos", "Hotel surroundings": "Umgebung des Hotels", - "Show map": "Karte anzeigen" + "Show map": "Karte anzeigen", + "Where to": "Wohin", + "When": "Wann", + "Rooms & Guests": "Zimmer & Gäste", + "Booking codes and vouchers": "Buchungscodes und Gutscheine" } diff --git a/i18n/dictionaries/en.json b/i18n/dictionaries/en.json index 7e46b4e0c..365535e30 100644 --- a/i18n/dictionaries/en.json +++ b/i18n/dictionaries/en.json @@ -139,5 +139,9 @@ "Room facilities": "Room facilities", "Hotel facilities": "Hotel facilities", "Hotel surroundings": "Hotel surroundings", - "Show map": "Show map" + "Show map": "Show map", + "Where to": "Where to", + "When": "When", + "Rooms & Guests": "Rooms & Guests", + "Booking codes and vouchers": "Booking codes and vouchers" } diff --git a/i18n/dictionaries/fi.json b/i18n/dictionaries/fi.json index 56093a1e4..5b516890b 100644 --- a/i18n/dictionaries/fi.json +++ b/i18n/dictionaries/fi.json @@ -134,5 +134,9 @@ "Room facilities": "Huoneen varustelu", "Hotel facilities": "Hotellin palvelut", "Hotel surroundings": "Hotellin ympäristö", - "Show map": "Näytä kartta" + "Show map": "Näytä kartta", + "Where to": "Minne", + "When": "Kun", + "Rooms & Guestss": "Huoneet & Vieraat", + "Booking codes and vouchers": "Varauskoodit ja kupongit" } diff --git a/i18n/dictionaries/no.json b/i18n/dictionaries/no.json index c1c219e0b..87993b450 100644 --- a/i18n/dictionaries/no.json +++ b/i18n/dictionaries/no.json @@ -134,5 +134,9 @@ "Room facilities": "Romfasiliteter", "Hotel facilities": "Hotelfaciliteter", "Hotel surroundings": "Hotellomgivelser", - "Show map": "Vis kart" + "Show map": "Vis kart", + "Where to": "Hvor skal du", + "When": "Når", + "Rooms & Guests": "Rom og gjester", + "Booking codes and vouchers": "Bestillingskoder og kuponger" } diff --git a/i18n/dictionaries/sv.json b/i18n/dictionaries/sv.json index 2038735f9..1641d8fb2 100644 --- a/i18n/dictionaries/sv.json +++ b/i18n/dictionaries/sv.json @@ -136,5 +136,9 @@ "Room facilities": "Rumlfaciliteter", "Hotel facilities": "Hotellfaciliteter", "Hotel surroundings": "Hotellomgivning", - "Show map": "Visa karta" + "Show map": "Visa karta", + "Where to": "Vart", + "When": "När", + "Rooms & Guests": "Rum och gäster", + "Booking codes and vouchers": "Bokningskoder och kuponger" }