feat: event type tabs platform wrapper (#16891)

* added event-type platform wrappers

* added weekly

* Update RecurringEventController.tsx
This commit is contained in:
Somay Chauhan authored and GitHub committed 2024-10-10 10:55:13 +03:00
1 parent 375b9190a3
commit 513a58c91c
5 files changed
+29 -6

No files matched your search

@@ -1668,6 +1668,7 @@
"billing_frequency": "Billing Frequency",
"monthly": "Monthly",
"yearly": "Yearly",
"weekly": "Weekly",
"checkout": "Checkout",
"your_team_disbanded_successfully": "Your team has been disbanded successfully",
"your_org_disbanded_successfully": "Your organization has been disbanded successfully",
@@ -0,0 +1,8 @@
import { EventLimitsTab } from "@calcom/features/eventtypes/components/tabs/limits/EventLimitsTab";
import type { EventLimitsTabProps } from "@calcom/features/eventtypes/components/tabs/limits/EventLimitsTab";
const EventLimitsTabPlatformWrapper = (props: EventLimitsTabProps) => {
return <EventLimitsTab {...props} />;
};
export default EventLimitsTabPlatformWrapper;
@@ -0,0 +1,10 @@
import { EventRecurringTab } from "@calcom/features/eventtypes/components/tabs/recurring/EventRecurringTab";
import type { EventTypeSetupProps } from "@calcom/features/eventtypes/lib/types";
export type EventRecurringWebWrapperProps = Pick<EventTypeSetupProps, "eventType">;
const EventRecurringTabPlatformWrapper = (props: EventRecurringWebWrapperProps) => {
return <EventRecurringTab {...props} />;
};
export default EventRecurringTabPlatformWrapper;
@@ -17,6 +17,8 @@ import { useAtomUpdateEventType } from "../hooks/useAtomUpdateEventType";
import { useEventTypeForm } from "../hooks/useEventTypeForm";
import { useHandleRouteChange } from "../hooks/useHandleRouteChange";
import { usePlatformTabsNavigations } from "../hooks/usePlatformTabsNavigations";
import EventLimitsTabPlatformWrapper from "./EventLimitsTabPlatformWrapper";
import EventRecurringTabPlatformWrapper from "./EventRecurringTabPlatformWrapper";
import SetupTab from "./EventSetupTabPlatformWrapper";
export type PlatformTabs = keyof Omit<TabMap, "workflows" | "webhooks" | "instant" | "ai" | "apps">;
@@ -29,9 +31,7 @@ export type EventTypePlatformWrapperProps = {
};
const EventType = ({
tabs = ["setup", "availability", "team", "limits", "advanced"],
onSuccess,
onError,
tabs = ["setup", "availability", "team", "limits", "advanced", "recurring"],
...props
}: EventTypeSetupProps & EventTypePlatformWrapperProps) => {
const { t } = useLocale();
@@ -87,10 +87,14 @@ const EventType = ({
),
availability: <></>,
team: <></>,
limits: <></>,
limits: tabs.includes("limits") ? <EventLimitsTabPlatformWrapper eventType={eventType} /> : <></>,
advanced: <></>,
instant: <></>,
recurring: <></>,
recurring: tabs.includes("recurring") ? (
<EventRecurringTabPlatformWrapper eventType={eventType} />
) : (
<></>
),
apps: <></>,
workflows: <></>,
webhooks: <></>,
@@ -86,7 +86,7 @@ export default function Bookings(props: { calUsername: string; calEmail: string
<div>
<EventTypeSettings
id={eventTypeId}
tabs={["setup"]}
tabs={["setup", "limits", "recurring", "advanced"]}
onSuccess={(eventType) => {
console.log(eventType);
setEventTypeId(null);