fix(sw-350): fixed ui-comments for calendar, search and widget

This commit is contained in:
Pontus Dreij
2024-10-14 12:04:05 +02:00
parent 89d65cec38
commit b3b26be83c
16 changed files with 80 additions and 47 deletions

View File

@@ -1,4 +1,5 @@
"use client"
import { useState } from "react"
import { useWatch } from "react-hook-form"
import { useIntl } from "react-intl"
@@ -22,6 +23,7 @@ export default function FormContent({
formId,
}: BookingWidgetFormContentProps) {
const intl = useIntl()
const [isDatePickerOpen, setIsDatePickerOpen] = useState(false)
const selectedDate = useWatch({ name: "date" })
const rooms = intl.formatMessage({ id: "Guests & Rooms" })
@@ -35,14 +37,14 @@ export default function FormContent({
<div className={styles.where}>
<Search locations={locations} />
</div>
<div className={styles.when}>
<div className={isDatePickerOpen ? styles.whenOpen : styles.when}>
<Caption color="red" textTransform="bold">
{intl.formatMessage(
{ id: "booking.nights" },
{ totalNights: nights }
)}
</Caption>
<DatePicker />
<DatePicker onToggleOpen={setIsDatePickerOpen} />
</div>
<div className={styles.rooms}>
<label>