From 93c4211da48a2e8a5e5d7d9bfedcb4ad538eb105 Mon Sep 17 00:00:00 2001 From: "GitStart-Cal.com" <121884634+gitstart-calcom@users.noreply.github.com> Date: Tue, 30 May 2023 09:43:24 -0600 Subject: [PATCH] change request (#9075) Co-authored-by: gitstart-calcom Co-authored-by: Peer Richelsen Co-authored-by: Bailey Pumfleet --- .../eventtype/EventTypeSingleLayout.tsx | 50 ++++++++++++------- apps/web/pages/event-types/index.tsx | 25 +++++++++- 2 files changed, 55 insertions(+), 20 deletions(-) diff --git a/apps/web/components/eventtype/EventTypeSingleLayout.tsx b/apps/web/components/eventtype/EventTypeSingleLayout.tsx index 72a1778f4f..c19f168a05 100644 --- a/apps/web/components/eventtype/EventTypeSingleLayout.tsx +++ b/apps/web/components/eventtype/EventTypeSingleLayout.tsx @@ -238,20 +238,34 @@ function EventTypeSingleLayout({
{!eventType.metadata.managedEventConfig && ( <> -
- - {t("hide_from_profile")} - - { - formMethods.setValue("hidden", e); - }} - /> + @@ -344,18 +358,18 @@ function EventTypeSingleLayout({ -
+
- {t("hide_from_profile")} + {formMethods.watch("hidden") ? t("show_eventtype_on_profile") : t("hide_from_profile")} { - formMethods.setValue("hidden", e); + formMethods.setValue("hidden", !e); }} />
diff --git a/apps/web/pages/event-types/index.tsx b/apps/web/pages/event-types/index.tsx index d292055181..453bb5f4f8 100644 --- a/apps/web/pages/event-types/index.tsx +++ b/apps/web/pages/event-types/index.tsx @@ -42,6 +42,8 @@ import { CreateButton, HorizontalTabs, HeadSeo, + Skeleton, + Label, } from "@calcom/ui"; import { ArrowDown, @@ -416,7 +418,8 @@ export const EventTypeList = ({ group, groupIndex, readOnly, types }: EventTypeL {!isManagedEventType && ( <> {type.hidden && {t("hidden")}} - +
- )} + + {!isManagedEventType && ( +
+ + {type.hidden ? t("show_eventtype_on_profile") : t("hide_from_profile")} + + { + setHiddenMutation.mutate({ id: type.id, hidden: !type.hidden }); + }} + /> +
+ )}