Merged in fix/sw-350-booking-widget-ui-fixes (pull request #683)

Fix/sw 350 booking widget ui fixes

Approved-by: Simon.Emanuelsson
This commit is contained in:
Pontus Dreij
2024-10-15 11:23:41 +00:00
17 changed files with 73 additions and 44 deletions

View File

@@ -1,4 +1,5 @@
"use client"
import { useState } from "react"
import { useWatch } from "react-hook-form"
import { useIntl } from "react-intl"
@@ -20,7 +21,6 @@ import type { BookingWidgetFormContentProps } from "@/types/components/form/book
export default function FormContent({
locations,
formId,
formState,
}: BookingWidgetFormContentProps) {
const intl = useIntl()
const selectedDate = useWatch({ name: "date" })
@@ -40,7 +40,7 @@ export default function FormContent({
<Caption color="red" textTransform="bold">
{intl.formatMessage(
{ id: "booking.nights" },
{ totalNights: nights }
{ totalNights: nights > 0 ? nights : 0 }
)}
</Caption>
<DatePicker />
@@ -60,7 +60,6 @@ export default function FormContent({
<div className={styles.buttonContainer}>
<Button
className={styles.button}
disabled={!formState.isValid}
form={formId}
intent="primary"
theme="base"