Skip to content

Commit

Permalink
fix/fix-animations on event-types/[type]
Browse files Browse the repository at this point in the history
  • Loading branch information
DmytroHryshyn committed Dec 20, 2023
1 parent e248dfb commit ca119bb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@calcom/tsconfig": "*",
"@calcom/ui": "*",
"@daily-co/daily-js": "^0.37.0",
"@formkit/auto-animate": "^1.0.0-beta.5",
"@formkit/auto-animate": "^0.8.1",
"@glidejs/glide": "^3.5.2",
"@hookform/error-message": "^2.0.0",
"@hookform/resolvers": "^2.9.7",
Expand Down
26 changes: 26 additions & 0 deletions apps/web/pages/event-types/[type]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,32 @@ const EventTypePage = (props: EventTypeSetupProps) => {
const [slugExistsChildrenDialogOpen, setSlugExistsChildrenDialogOpen] = useState<ChildrenEventType[]>([]);
const slug = formMethods.watch("slug") ?? eventType.slug;

// Optional prerender all tabs after 300 ms on mount
useEffect(() => {
const timeout = setTimeout(() => {
const Components = [
EventSetupTab,
EventAvailabilityTab,
EventTeamTab,
EventLimitsTab,
EventAdvancedTab,
EventInstantTab,
EventRecurringTab,
EventAppsTab,
EventWorkflowsTab,
EventWebhooksTab,
];

Components.forEach((C) => {
// @ts-expect-error Property 'render' does not exist on type 'ComponentClass
C.render.preload();
});
}, 300);

return () => {
clearTimeout(timeout);
};
}, []);
return (
<>
<EventTypeSingleLayout
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"dependencies": {
"@calcom/lib": "*",
"@calcom/trpc": "*",
"@formkit/auto-animate": "^1.0.0-beta.5",
"@formkit/auto-animate": "^0.8.1",
"@radix-ui/react-checkbox": "^1.0.4",
"@radix-ui/react-dialog": "^1.0.4",
"@radix-ui/react-popover": "^1.0.2",
Expand Down

0 comments on commit ca119bb

Please sign in to comment.