chore: Cleanup booking widget with types and other minor issues
This commit is contained in:
@@ -31,10 +31,8 @@ export default function FormContent({
|
||||
const {
|
||||
formState: { errors },
|
||||
} = useFormContext<BookingWidgetSchema>()
|
||||
const bookingCodeError = errors["bookingCode"]?.value
|
||||
const selectedDate = useWatch({ name: "date" })
|
||||
|
||||
const roomsLabel = intl.formatMessage({ id: "Rooms & Guests" })
|
||||
const selectedDate = useWatch({ name: "date" })
|
||||
|
||||
const nights = dt(selectedDate.toDate).diff(dt(selectedDate.fromDate), "days")
|
||||
|
||||
@@ -63,7 +61,7 @@ export default function FormContent({
|
||||
<div className={styles.rooms}>
|
||||
<label>
|
||||
<Caption color="red" type="bold" asChild>
|
||||
<span>{roomsLabel}</span>
|
||||
<span>{intl.formatMessage({ id: "Rooms & Guests" })}</span>
|
||||
</Caption>
|
||||
</label>
|
||||
<GuestsRoomsPickerForm />
|
||||
@@ -86,7 +84,7 @@ export default function FormContent({
|
||||
<Voucher />
|
||||
</div>
|
||||
<div className={`${styles.buttonContainer} ${styles.hideOnTablet}`}>
|
||||
{bookingCodeError?.message?.indexOf("Multi-room") === 0 ? (
|
||||
{errors.bookingCode?.value?.message?.indexOf("Multi-room") === 0 ? (
|
||||
<RemoveExtraRooms
|
||||
size="medium"
|
||||
fullWidth
|
||||
|
||||
Reference in New Issue
Block a user