diff --git a/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx b/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx index 507aecffa9..82142f71d4 100644 --- a/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx +++ b/packages/features/bookings/Booker/components/BookEventForm/BookEventForm.tsx @@ -2,7 +2,7 @@ import { zodResolver } from "@hookform/resolvers/zod"; import type { UseMutationResult } from "@tanstack/react-query"; import { useMutation } from "@tanstack/react-query"; import { useRouter } from "next/router"; -import { useMemo } from "react"; +import { useMemo, useRef } from "react"; import type { FieldError } from "react-hook-form"; import { useForm } from "react-hook-form"; import type { TFunction } from "react-i18next"; @@ -61,6 +61,8 @@ export const BookEventForm = ({ onCancel }: BookEventFormProps) => { const router = useRouter(); const { t, i18n } = useLocale(); const { timezone } = useTimePreferences(); + const errorRef = useRef(null); + const rescheduleUid = useBookerStore((state) => state.rescheduleUid); const rescheduleBooking = useBookerStore((state) => state.rescheduleBooking); const eventSlug = useBookerStore((state) => state.eventSlug); @@ -185,6 +187,10 @@ export const BookEventForm = ({ onCancel }: BookEventFormProps) => { }) ); }, + onError: () => { + + errorRef && errorRef.current?.scrollIntoView({ behavior: "smooth" }); + }, }); const createRecurringBookingMutation = useMutation(createRecurringBooking, { @@ -282,7 +288,24 @@ export const BookEventForm = ({ onCancel }: BookEventFormProps) => { locations={eventType.locations} rescheduleUid={rescheduleUid || undefined} /> - + {(createBookingMutation.isError || + createRecurringBookingMutation.isError || + bookingForm.formState.errors["globalError"]) && ( +
+ +
+ )}
{!!onCancel && (
- {(createBookingMutation.isError || - createRecurringBookingMutation.isError || - bookingForm.formState.errors["globalError"]) && ( -
- -
- )} ); }; diff --git a/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx b/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx index 0165803cb0..f220be657b 100644 --- a/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx +++ b/packages/features/bookings/Booker/components/BookEventForm/BookFormAsModal.tsx @@ -20,9 +20,9 @@ export function BookFormAsModal({ visible, onCancel }: { visible: boolean; onCan -

{t("confirm_your_details")}

-
+ className="[&_.modalsticky]:border-t-subtle [&_.modalsticky]:bg-default max-h-[80vh] pt-6 pb-0 [&_.modalsticky]:sticky [&_.modalsticky]:bottom-0 [&_.modalsticky]:left-0 [&_.modalsticky]:right-0 [&_.modalsticky]:-mx-8 [&_.modalsticky]:border-t [&_.modalsticky]:px-6 [&_.modalsticky]:py-4"> +

{t("confirm_your_details")}

+
{parsedSelectedTimeslot.format("LLL")} diff --git a/packages/features/package.json b/packages/features/package.json index 2e74a919af..6a90f42fd2 100644 --- a/packages/features/package.json +++ b/packages/features/package.json @@ -14,6 +14,7 @@ "dompurify": "^2.4.1", "framer-motion": "^10.12.8", "lexical": "^0.5.0", + "react-select": "^5.7.0", "react-sticky-box": "^2.0.4", "zustand": "^4.3.2" }, diff --git a/packages/features/shell/Shell.tsx b/packages/features/shell/Shell.tsx index c9e1080bb5..2945879e99 100644 --- a/packages/features/shell/Shell.tsx +++ b/packages/features/shell/Shell.tsx @@ -307,11 +307,11 @@ function UserDropdown({ small }: { small?: boolean }) { {!small && ( - - + + {user.name || "Nameless User"} - + {user.username ? process.env.NEXT_PUBLIC_WEBSITE_URL === "https://cal.com" ? `cal.com/${user.username}` diff --git a/packages/ui/components/alert/Alert.tsx b/packages/ui/components/alert/Alert.tsx index 390ac6039b..558bb7a6e5 100644 --- a/packages/ui/components/alert/Alert.tsx +++ b/packages/ui/components/alert/Alert.tsx @@ -1,6 +1,7 @@ import { CheckCircleIcon, ExclamationIcon, InformationCircleIcon, XCircleIcon } from "@heroicons/react/solid"; import classNames from "classnames"; import type { ReactNode } from "react"; +import { forwardRef } from "react"; import { Info } from "../icon"; @@ -15,11 +16,12 @@ export interface AlertProps { // @TODO: Success and info shouldn't exist as per design? severity: "success" | "warning" | "error" | "info" | "neutral"; } -export function Alert(props: AlertProps) { +export const Alert = forwardRef((props, ref) => { const { severity, iconClassName } = props; return (
); -} +}); + +Alert.displayName = "Alert";