diff --git a/packages/platform/atoms/event-types/hooks/usePlatformTabsNavigations.tsx b/packages/platform/atoms/event-types/hooks/usePlatformTabsNavigations.tsx index 4265dbda0d..c9420ec66c 100644 --- a/packages/platform/atoms/event-types/hooks/usePlatformTabsNavigations.tsx +++ b/packages/platform/atoms/event-types/hooks/usePlatformTabsNavigations.tsx @@ -63,7 +63,7 @@ export const usePlatformTabsNavigations = ({ formMethods, eventType, team, tabs currentTab, }); - if (!requirePayment) { + if (!requirePayment && tabs.includes("recurring")) { navigation.splice(3, 0, { name: "recurring", onClick: () => setCurrentTab("recurring"), @@ -74,28 +74,29 @@ export const usePlatformTabsNavigations = ({ formMethods, eventType, team, tabs }); } - navigation.splice(1, 0, { - name: "availability", - onClick: () => setCurrentTab("availability"), - isActive: currentTab === "availability", - href: `${url}?tabName=availability`, - icon: "calendar", - info: - isManagedEventType || isChildrenManagedEventType - ? formMethods.getValues("schedule") === null - ? "members_default_schedule" - : isChildrenManagedEventType - ? `${ - formMethods.getValues("scheduleName") - ? `${formMethods.getValues("scheduleName")} - ${t("managed")}` - : `default_schedule_name` - }` - : formMethods.getValues("scheduleName") ?? `default_schedule_name` - : formMethods.getValues("scheduleName") ?? `default_schedule_name`, - }); + tabs.includes("availability") && + navigation.splice(1, 0, { + name: "availability", + onClick: () => setCurrentTab("availability"), + isActive: currentTab === "availability", + href: `${url}?tabName=availability`, + icon: "calendar", + info: + isManagedEventType || isChildrenManagedEventType + ? formMethods.getValues("schedule") === null + ? "members_default_schedule" + : isChildrenManagedEventType + ? `${ + formMethods.getValues("scheduleName") + ? `${formMethods.getValues("scheduleName")} - ${t("managed")}` + : `default_schedule_name` + }` + : formMethods.getValues("scheduleName") ?? `default_schedule_name` + : formMethods.getValues("scheduleName") ?? `default_schedule_name`, + }); // If there is a team put this navigation item within the tabs - if (team) { + if (team && tabs.includes("team")) { navigation.splice(2, 0, { name: "assignment", onClick: () => setCurrentTab("team"),