feat: added customClassnames to event-availability tab (#17268)
* feat: added customClassnames to event-availability tab * added classNames to common types * use common classnames type * Update types.ts * update name * fix: better classnames * better calssnames * Update types.ts
This commit is contained in:
1 parent
1cf84a270c
commit
4d578d2cdf
7 files changed
+324
-62
No files matched your search
@@ -1,5 +1,6 @@
|
||||
import { useFormContext } from "react-hook-form";
|
||||
|
||||
import type { EventAvailabilityTabCustomClassNames } from "@calcom/features/eventtypes/components/tabs/availability/EventAvailabilityTab";
|
||||
import { EventAvailabilityTab } from "@calcom/features/eventtypes/components/tabs/availability/EventAvailabilityTab";
|
||||
import type { EventTypeSetup, FormValues } from "@calcom/features/eventtypes/lib/types";
|
||||
import type { User } from "@calcom/prisma/client";
|
||||
@@ -16,6 +17,7 @@ type EventAvailabilityTabPlatformWrapperProps = {
|
||||
eventType: EventTypeSetup;
|
||||
isTeamEvent: boolean;
|
||||
teamId?: number;
|
||||
customClassNames?: EventAvailabilityTabCustomClassNames;
|
||||
};
|
||||
|
||||
const EventAvailabilityTabPlatformWrapper = ({
|
||||
|
||||
@@ -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 { EventAvailabilityTabCustomClassNames } from "@calcom/features/eventtypes/components/tabs/availability/EventAvailabilityTab";
|
||||
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";
|
||||
@@ -30,6 +31,10 @@ import SetupTab from "./EventSetupTabPlatformWrapper";
|
||||
import EventTeamAssignmentTabPlatformWrapper from "./EventTeamAssignmentTabPlatformWrapper";
|
||||
|
||||
export type PlatformTabs = keyof Omit<TabMap, "workflows" | "webhooks" | "instant" | "ai" | "apps">;
|
||||
export type eventTypeCustomClassNames = {
|
||||
atomsWrapper?: string;
|
||||
eventAvailabilityTab?: EventAvailabilityTabCustomClassNames;
|
||||
};
|
||||
|
||||
export type EventTypeCustomClassNames = {
|
||||
atomsWrapper?: string;
|
||||
@@ -44,6 +49,7 @@ export type EventTypePlatformWrapperProps = {
|
||||
onDeleteSuccess?: () => void;
|
||||
onDeleteError?: (msg: string) => void;
|
||||
allowDelete: boolean;
|
||||
customClassNames?: eventTypeCustomClassNames;
|
||||
customClassNames?: EventTypeCustomClassNames;
|
||||
disableToasts?: boolean;
|
||||
};
|
||||
@@ -158,6 +164,7 @@ const EventType = ({
|
||||
isTeamEvent={!!team}
|
||||
user={user?.data}
|
||||
teamId={team?.id}
|
||||
customClassNames={customClassNames?.eventAvailabilityTab}
|
||||
/>
|
||||
) : (
|
||||
<></>
|
||||
|
||||
@@ -97,6 +97,60 @@ export default function Bookings(props: { calUsername: string; calEmail: string
|
||||
<EventTypeSettings
|
||||
customClassNames={{
|
||||
atomsWrapper: "!w-[50vw] !m-auto",
|
||||
eventAvailabilityTab: {
|
||||
teamAvailability: {
|
||||
chooseHostSchedulesLabelContainer: "border border-purple-200 bg-purple-50 rounded-md p-4",
|
||||
chooseHostSchedulesLabel: "text-purple-700 font-semibold",
|
||||
chooseHostSchedulesLabelDescription: "text-gray-600",
|
||||
teamAvailibilityContainer: "mt-4 border border-purple-200 bg-white rounded-lg p-6",
|
||||
teamMemberSchedule: {
|
||||
labelAvatar: "rounded-full border border-purple-300",
|
||||
labelContainer: "flex items-center gap-2",
|
||||
innerClassNames: {
|
||||
input: "text-purple-900",
|
||||
option: "hover:bg-purple-100",
|
||||
control: "border-purple-300",
|
||||
singleValue: "text-purple-700",
|
||||
valueContainer: "",
|
||||
multiValue: "",
|
||||
menu: "border border-purple-200 rounded-md",
|
||||
menuList: "",
|
||||
},
|
||||
select: "border border-purple-300 rounded-md bg-white",
|
||||
label: "text-purple-700",
|
||||
container: "",
|
||||
},
|
||||
},
|
||||
userAvailability: {
|
||||
availabilitySectionContainer: "border border-purple-200 bg-white rounded-lg p-6",
|
||||
availabilitySelect: {
|
||||
innerClassNames: {
|
||||
input: "text-purple-900",
|
||||
option: "hover:bg-purple-100",
|
||||
control: "border-purple-300",
|
||||
singleValue: "text-purple-700",
|
||||
valueContainer: "",
|
||||
multiValue: "",
|
||||
menu: "border border-purple-200 rounded-md",
|
||||
menuList: "",
|
||||
},
|
||||
select: "border border-purple-300 rounded-md bg-white",
|
||||
label: "text-purple-700",
|
||||
container: "",
|
||||
},
|
||||
availabilityTable: {
|
||||
tableContainer: "border border-purple-200 rounded-md bg-white mt-4",
|
||||
table: "w-full table-auto",
|
||||
tableRow: "hover:bg-purple-50",
|
||||
day: "text-purple-800 font-semibold",
|
||||
dayUnavailable: "text-gray-400",
|
||||
dayAvailabilityContainer: "flex items-center gap-2",
|
||||
dayAvailabilityFrom: "text-purple-700",
|
||||
dayAvailabilityTo: "text-purple-700",
|
||||
dayAvailabilitySeperator: "text-purple-500",
|
||||
},
|
||||
},
|
||||
},
|
||||
eventRecurringTab: {
|
||||
container: "border border-purple-200 bg-purple-50 rounded-lg shadow-sm",
|
||||
recurringToggle: {
|
||||
|
||||
Reference in new issue
Block a user