feat: added customClassnames for event-recurring tab (#17551)

* added classNames to common types

* Update types.ts

* feat: added custom classnames to event-recurring tab

* Update EventTypePlatformWrapper.tsx

* customClassnames -> customClassNames

* added example classnames for demo

* fixed classnames
This commit is contained in:
Somay Chauhan authored and GitHub committed 2024-11-22 12:30:02 +05:30
1 parent 4b34aec13d
commit d03651312e
7 files changed
+168 -31

No files matched your search

@@ -1,9 +1,7 @@
import type { EventRecurringTabProps } from "@calcom/features/eventtypes/components/tabs/recurring/EventRecurringTab";
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) => {
const EventRecurringTabPlatformWrapper = (props: EventRecurringTabProps) => {
return <EventRecurringTab {...props} />;
};
@@ -1,9 +1,7 @@
import type { EventRecurringTabProps } from "@calcom/features/eventtypes/components/tabs/recurring/EventRecurringTab";
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 EventRecurringWebWrapper = (props: EventRecurringWebWrapperProps) => {
const EventRecurringWebWrapper = (props: EventRecurringTabProps) => {
return <EventRecurringTab {...props} />;
};
@@ -6,6 +6,7 @@ import { useRef, useState, useEffect } from "react";
import type { ChildrenEventType } from "@calcom/features/eventtypes/components/ChildrenEventTypeSelect";
import { EventType as EventTypeComponent } from "@calcom/features/eventtypes/components/EventType";
import ManagedEventTypeDialog from "@calcom/features/eventtypes/components/dialogs/ManagedEventDialog";
import type { EventRecurringTabCustomClassNames } from "@calcom/features/eventtypes/components/tabs/recurring/RecurringEventController";
import type { EventTypeSetupProps, FormValues, TabMap } from "@calcom/features/eventtypes/lib/types";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { SchedulingType } from "@calcom/prisma/enums";
@@ -30,6 +31,11 @@ import EventTeamAssignmentTabPlatformWrapper from "./EventTeamAssignmentTabPlatf
export type PlatformTabs = keyof Omit<TabMap, "workflows" | "webhooks" | "instant" | "ai" | "apps">;
export type EventTypeCustomClassNames = {
atomsWrapper?: string;
eventRecurringTab?: EventRecurringTabCustomClassNames;
};
export type EventTypePlatformWrapperProps = {
id: number;
tabs?: PlatformTabs[];
@@ -38,9 +44,7 @@ export type EventTypePlatformWrapperProps = {
onDeleteSuccess?: () => void;
onDeleteError?: (msg: string) => void;
allowDelete: boolean;
customClassNames?: {
atomsWrapper?: string;
};
customClassNames?: EventTypeCustomClassNames;
disableToasts?: boolean;
};
@@ -178,7 +182,10 @@ const EventType = ({
limits: tabs.includes("limits") ? <EventLimitsTabPlatformWrapper eventType={eventType} /> : <></>,
instant: <></>,
recurring: tabs.includes("recurring") ? (
<EventRecurringTabPlatformWrapper eventType={eventType} />
<EventRecurringTabPlatformWrapper
eventType={eventType}
customClassNames={customClassNames?.eventRecurringTab}
/>
) : (
<></>
),
@@ -95,7 +95,47 @@ export default function Bookings(props: { calUsername: string; calEmail: string
{eventTypeId && (
<div>
<EventTypeSettings
customClassNames={{ atomsWrapper: "!w-[50vw] !m-auto" }}
customClassNames={{
atomsWrapper: "!w-[50vw] !m-auto",
eventRecurringTab: {
container: "border border-purple-200 bg-purple-50 rounded-lg shadow-sm",
recurringToggle: {
container: "border border-purple-200 bg-purple-100 rounded-lg",
label: "text-purple-700",
description: "text-purple-500",
children: "bg-purple-50 rounded-md",
},
frequencyInput: {
container: "border border-purple-200 bg-purple-100 rounded-lg",
label: "text-purple-700",
input: "border border-purple-300 rounded-md text-purple-900 bg-white",
addOn: "text-purple-500",
},
frequencyUnitSelect: {
select: "border border-purple-300 rounded-md text-purple-900 bg-purple-50",
label: "text-purple-700",
container: "mb-4",
innerClassNames: {
input: "text-purple-900",
option: "text-purple-700 hover:bg-purple-200",
control: "border-purple-300",
singleValue: "text-purple-900",
valueContainer: "bg-purple-100",
multiValue: "bg-purple-200 rounded-md text-purple-900",
menu: "border border-purple-200 rounded-md",
menuList: "",
},
},
maxEventsInput: {
countInput: "border border-purple-300 rounded-md text-purple-900 bg-white",
labelText: "text-purple-700",
suffixText: "text-purple-500",
container: "border border-purple-200 bg-purple-100 rounded-lg",
},
experimentalAlert: "border border-red-300 bg-red-50 rounded-lg text-red-900 shadow-sm",
paymentAlert: "border border-purple-300 bg-purple-100 rounded-lg text-purple-900 shadow-md",
},
}}
allowDelete={true}
id={eventTypeId}
tabs={["setup", "limits", "recurring", "advanced", "availability", "team", "payments"]}