perf: server-fetch data for all pages in /settings/my-account (#20712)
* wip * fix type check * refactor "/settings/my-account/profile" * refactor "settings/my-account/general" * refactor "/settings/my-accouunt/calendars" * refactor "/settings/my-account/appearance" * fix: type-check --------- Co-authored-by: Amit Sharma <[email protected]> Co-authored-by: Amit Sharma <[email protected]>
This commit is contained in:
32 files changed
+721
-524
No files matched your search
@@ -12,6 +12,7 @@ import type { BulkUpdatParams } from "@calcom/features/eventtypes/components/Bul
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { AppCategories } from "@calcom/prisma/enums";
|
||||
import { trpc } from "@calcom/trpc/react";
|
||||
import type { RouterOutputs } from "@calcom/trpc/react";
|
||||
import { Button } from "@calcom/ui/components/button";
|
||||
import { EmptyScreen } from "@calcom/ui/components/empty-screen";
|
||||
import type { Icon } from "@calcom/ui/components/icon";
|
||||
@@ -181,9 +182,11 @@ type ModalState = {
|
||||
|
||||
type PageProps = {
|
||||
category: AppCategories;
|
||||
connectedCalendars: RouterOutputs["viewer"]["calendars"]["connectedCalendars"];
|
||||
installedCalendars: RouterOutputs["viewer"]["apps"]["integrations"];
|
||||
};
|
||||
|
||||
export default function InstalledApps({ category }: PageProps) {
|
||||
export default function InstalledApps({ category, connectedCalendars, installedCalendars }: PageProps) {
|
||||
const { t } = useLocale();
|
||||
const utils = trpc.useUtils();
|
||||
const categoryList: AppCategories[] = Object.values(AppCategories).filter((category) => {
|
||||
@@ -233,7 +236,12 @@ export default function InstalledApps({ category }: PageProps) {
|
||||
{categoryList.includes(category) && (
|
||||
<IntegrationsContainer handleDisconnect={handleDisconnect} variant={category} />
|
||||
)}
|
||||
{category === "calendar" && <CalendarListContainer />}
|
||||
{category === "calendar" && (
|
||||
<CalendarListContainer
|
||||
connectedCalendars={connectedCalendars}
|
||||
installedCalendars={installedCalendars}
|
||||
/>
|
||||
)}
|
||||
{category === "other" && (
|
||||
<IntegrationsContainer
|
||||
handleDisconnect={handleDisconnect}
|
||||
|
||||
Reference in new issue
Block a user