feat(SW-240): add translations

This commit is contained in:
Fredrik Thorsson
2024-08-13 09:09:33 +02:00
parent 01bd7d2299
commit a3602b285b
9 changed files with 71 additions and 23 deletions

View File

@@ -1,21 +1,35 @@
.container { .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 * Update the styles after mobile UX is ready
*/ */
@media screen and (min-width: 1367px) { @media screen and (max-width: 1367px) {
.container { .container {
display: grid; display: none;
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;
} }
} }

View File

@@ -1,6 +1,7 @@
"use client" "use client"
import { zodResolver } from "@hookform/resolvers/zod" import { zodResolver } from "@hookform/resolvers/zod"
import { FormProvider, useForm } from "react-hook-form" import { FormProvider, useForm } from "react-hook-form"
import { useIntl } from "react-intl"
import { dt } from "@/lib/dt" import { dt } from "@/lib/dt"
@@ -12,6 +13,8 @@ import styles from "./bookingWidget.module.css"
import { type BookingWidgetSchema } from "@/types/components/bookingWidget" import { type BookingWidgetSchema } from "@/types/components/bookingWidget"
export function BookingWidget() { export function BookingWidget() {
const { formatMessage } = useIntl()
const methods = useForm<BookingWidgetSchema>({ const methods = useForm<BookingWidgetSchema>({
defaultValues: { defaultValues: {
search: { search: {
@@ -49,11 +52,18 @@ export function BookingWidget() {
<div id="booking-widget" className={styles.container}> <div id="booking-widget" className={styles.container}>
<form onSubmit={methods.handleSubmit(onSubmit)} className={styles.form}> <form onSubmit={methods.handleSubmit(onSubmit)} className={styles.form}>
<FormProvider {...methods}> <FormProvider {...methods}>
<div>Search</div> <div className={styles.input}>
<div>Nights</div> <div className={styles.where}>
<div>Rooms</div> {formatMessage({ id: "Where to" })}
<div>Bonus code</div> </div>
<div>Bonus cheque or reward nights</div> <div className={styles.when}>{formatMessage({ id: "When" })}</div>
<div className={styles.rooms}>
{formatMessage({ id: "Rooms & Guests" })}
</div>
<div className={styles.vouchers}>
{formatMessage({ id: "Booking codes and vouchers" })}
</div>
</div>
<Button type="submit">Search</Button> <Button type="submit">Search</Button>
</FormProvider> </FormProvider>
</form> </form>

View File

@@ -28,7 +28,7 @@ export default async function Header({
/** /**
* ToDo: Create logic to get this info from ContentStack based on page * ToDo: Create logic to get this info from ContentStack based on page
* */ * */
const hideBookingWidget = true const hideBookingWidget = false
if (!data) { if (!data) {
return null return null

View File

@@ -134,5 +134,9 @@
"Room facilities": "Værelsesfaciliteter", "Room facilities": "Værelsesfaciliteter",
"Hotel facilities": "Hotel faciliteter", "Hotel facilities": "Hotel faciliteter",
"Hotel surroundings": "Hotel omgivelser", "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"
} }

View File

@@ -128,5 +128,9 @@
"Room facilities": "Zimmerausstattung", "Room facilities": "Zimmerausstattung",
"Hotel facilities": "Hotel-Infos", "Hotel facilities": "Hotel-Infos",
"Hotel surroundings": "Umgebung des Hotels", "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"
} }

View File

@@ -139,5 +139,9 @@
"Room facilities": "Room facilities", "Room facilities": "Room facilities",
"Hotel facilities": "Hotel facilities", "Hotel facilities": "Hotel facilities",
"Hotel surroundings": "Hotel surroundings", "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"
} }

View File

@@ -134,5 +134,9 @@
"Room facilities": "Huoneen varustelu", "Room facilities": "Huoneen varustelu",
"Hotel facilities": "Hotellin palvelut", "Hotel facilities": "Hotellin palvelut",
"Hotel surroundings": "Hotellin ympäristö", "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"
} }

View File

@@ -134,5 +134,9 @@
"Room facilities": "Romfasiliteter", "Room facilities": "Romfasiliteter",
"Hotel facilities": "Hotelfaciliteter", "Hotel facilities": "Hotelfaciliteter",
"Hotel surroundings": "Hotellomgivelser", "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"
} }

View File

@@ -136,5 +136,9 @@
"Room facilities": "Rumlfaciliteter", "Room facilities": "Rumlfaciliteter",
"Hotel facilities": "Hotellfaciliteter", "Hotel facilities": "Hotellfaciliteter",
"Hotel surroundings": "Hotellomgivning", "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"
} }