Skip to content

Commit

Permalink
refactor: event limits web wrapper (#16679)
Browse files Browse the repository at this point in the history
* chore: EventTypeWebWrapper base pr

* fixup! chore: EventTypeWebWrapper base pr

* fixup! Merge branch 'main' into morgan/cal-4183-eventtypeatom-web-wrapper-base

* wip

* fix: error

* Event type atom wrapper handles app dir

* fixup! Merge branch 'main' into morgan/cal-4183-eventtypeatom-web-wrapper-base

* fixup! fixup! Merge branch 'main' into morgan/cal-4183-eventtypeatom-web-wrapper-base

* remove console log

* review comments

* refactor: event limits tab for atoms

* fixup! review comments

---------

Co-authored-by: Morgan Vernay <morgan@cal.com>
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 23, 2024
1 parent 2fb1408 commit bc34e67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { Button, DateRangePicker, InputField, Label, Select, SettingsToggle, Tex

type IPeriodType = (typeof PeriodType)[keyof typeof PeriodType];

export type EventLimitsTabProps = Pick<EventTypeSetupProps, "eventType">;

/**
* We technically have a ROLLING_WINDOW future limit option that isn't shown as a Radio Option. Because UX is better by providing it as a toggle with ROLLING Limit radio option.
* Also, ROLLING_WINDOW reuses the same `periodDays` field and `periodCountCalendarDays` fields
Expand Down Expand Up @@ -286,7 +288,7 @@ const MinimumBookingNoticeInput = React.forwardRef<
);
});

export const EventLimitsTab = ({ eventType }: Pick<EventTypeSetupProps, "eventType">) => {
export const EventLimitsTab = ({ eventType }: EventLimitsTabProps) => {
const { t, i18n } = useLocale();
const formMethods = useFormContext<FormValues>();

Expand Down
Original file line number Diff line number Diff line change
@@ -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 EventLimitsTabWebWrapper = (props: EventLimitsTabProps) => {
return <EventLimitsTab {...props} />;
};

export default EventLimitsTabWebWrapper;
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ const EventTeamAssignmentTab = dynamic(() =>

const EventLimitsTab = dynamic(() =>
// import web wrapper when it's ready
import("@calcom/features/eventtypes/components/tabs/limits/EventLimitsTab").then(
(mod) => mod.EventLimitsTab
)
import("./EventLimitsTabWebWrapper").then((mod) => mod)
);

const EventAdvancedTab = dynamic(() =>
Expand Down

0 comments on commit bc34e67

Please sign in to comment.