From 7d7c61a1abcbde0461a1468a8d531090544a98a3 Mon Sep 17 00:00:00 2001 From: sean-brydon <55134778+sean-brydon@users.noreply.github.com> Date: Mon, 23 May 2022 09:11:04 +0100 Subject: [PATCH] Adding labels (#2783) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/web/components/Shell.tsx | 1 + .../eventtype/RecurringEventController.tsx | 9 +-- apps/web/components/ui/form/CheckboxField.tsx | 66 ++++++++++++------- apps/web/pages/event-types/[type].tsx | 38 ++++++----- 4 files changed, 69 insertions(+), 45 deletions(-) diff --git a/apps/web/components/Shell.tsx b/apps/web/components/Shell.tsx index 7e2b634f97..beea8ff7d6 100644 --- a/apps/web/components/Shell.tsx +++ b/apps/web/components/Shell.tsx @@ -206,6 +206,7 @@ const Layout = ({
- + {t("recurring_event")}
{paymentEnabled ? ( @@ -79,10 +77,13 @@ export default function RecurringEventController({ className="text-primary-600 h-4 w-4 rounded border-gray-300" defaultChecked={recurringEventDefined} data-testid="recurring-event-check" + id="recurringEvent" />
-

{t("recurring_event_description")}

+
& { - label: React.ReactNode; + label?: React.ReactNode; description: string; + descriptionAsLabel?: boolean; + infomationIconText?: string; }; -const CheckboxField = forwardRef(({ label, description, ...rest }, ref) => { - return ( -
-
- -
-
-
-
- +const CheckboxField = forwardRef( + ({ label, description, infomationIconText, descriptionAsLabel, ...rest }, ref) => { + return ( +
+ {label && !descriptionAsLabel && ( +
+
-
-

{description}

+ )} + {label && descriptionAsLabel && ( +
+ {label} +
+ )} +
+
+
+ +
+
+ {!label || descriptionAsLabel ? ( + + ) : ( +

{description}

+ )} +
+ {infomationIconText && }
-
- ); -}); + ); + } +); CheckboxField.displayName = "CheckboxField"; diff --git a/apps/web/pages/event-types/[type].tsx b/apps/web/pages/event-types/[type].tsx index cedef0f9aa..7762df9876 100644 --- a/apps/web/pages/event-types/[type].tsx +++ b/apps/web/pages/event-types/[type].tsx @@ -592,6 +592,7 @@ const EventTypePage = (props: inferSSRProps) => { resolver: zodResolver(locationFormSchema), }); const Locations = () => { + const { t } = useLocale(); return (
{formMethods.getValues("locations").length === 0 && ( @@ -628,31 +629,25 @@ const EventTypePage = (props: inferSSRProps) => { {location.type === LocationType.InPerson && (
- + + {location.link} +
)} {location.type === LocationType.Link && (
- + + {location.link} +
)} {location.type === LocationType.UserPhone && (
- + + {location.hostPhoneNumber} +
)} {location.type === LocationType.Phone && ( @@ -1386,6 +1381,7 @@ const EventTypePage = (props: inferSSRProps) => { render={() => ( ) => { render={() => ( ) => { ) => { ) => {

-
+
-
+