diff --git a/apps/web/components/dialog/EditLocationDialog.tsx b/apps/web/components/dialog/EditLocationDialog.tsx index 63bfb909e5..ad90c68b16 100644 --- a/apps/web/components/dialog/EditLocationDialog.tsx +++ b/apps/web/components/dialog/EditLocationDialog.tsx @@ -73,6 +73,7 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { if (selection) { locationFormMethods.setValue("locationType", selection?.value); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [selection]); const locationFormSchema = z.object({ @@ -136,7 +137,7 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { onChange={(e) => locationFormMethods.setValue("displayLocationPublicly", e.target.checked) } - infomationIconText={t("display_location_info_badge")}> + informationIconText={t("display_location_info_badge")}> )} /> @@ -182,7 +183,7 @@ export const EditLocationDialog = (props: ISetLocationDialog) => { : undefined } onChange={(e) => locationFormMethods.setValue("displayLocationPublicly", e.target.checked)} - infomationIconText={t("display_location_info_badge")}> + informationIconText={t("display_location_info_badge")}> )} /> diff --git a/apps/web/components/ui/form/CheckboxField.tsx b/apps/web/components/ui/form/CheckboxField.tsx index f55468429a..867c092bb3 100644 --- a/apps/web/components/ui/form/CheckboxField.tsx +++ b/apps/web/components/ui/form/CheckboxField.tsx @@ -1,51 +1,60 @@ import React, { forwardRef, InputHTMLAttributes } from "react"; +import classNames from "@calcom/lib/classNames"; + import InfoBadge from "@components/ui/InfoBadge"; type Props = InputHTMLAttributes & { label?: React.ReactNode; description: string; descriptionAsLabel?: boolean; - infomationIconText?: string; + informationIconText?: string; }; const CheckboxField = forwardRef( - ({ label, description, infomationIconText, descriptionAsLabel, ...rest }, ref) => { + ({ label, description, informationIconText, ...rest }, ref) => { + const descriptionAsLabel = !label || rest.descriptionAsLabel; return (
- {label && !descriptionAsLabel && ( + {label && (
- -
- )} - {label && descriptionAsLabel && ( -
- {label} + {React.createElement( + descriptionAsLabel ? "div" : "label", + { + className: "flex text-sm font-medium text-neutral-700", + ...(!descriptionAsLabel + ? { + htmlFor: rest.id, + } + : {}), + }, + label + )}
)}
-
- -
-
- {!label || descriptionAsLabel ? ( - - ) : ( -

{description}

- )} -
- {infomationIconText && } + {React.createElement( + descriptionAsLabel ? "label" : "div", + { + className: classNames( + "relative flex items-start", + descriptionAsLabel ? "text-neutral-700" : "text-neutral-900" + ), + }, + <> +
+ +
+ {description} + + )} + {informationIconText && }