From a5edeb1f2676ec2182dda5fc6c78a1b1ea0d3bbc Mon Sep 17 00:00:00 2001 From: hbjORbj Date: Sat, 18 Jan 2025 18:27:45 -0500 Subject: [PATCH] move /insights pages --- .../(use-page-wrapper)}/insights/layout.tsx | 9 +++------ apps/web/app/{ => (use-page-wrapper)}/insights/page.tsx | 0 .../{ => (use-page-wrapper)}/insights/routing/page.tsx | 0 .../insights/virtual-queues/page.tsx | 0 apps/web/app/insights/layout.tsx | 5 ----- 5 files changed, 3 insertions(+), 11 deletions(-) rename apps/web/{modules => app/(use-page-wrapper)}/insights/layout.tsx (88%) rename apps/web/app/{ => (use-page-wrapper)}/insights/page.tsx (100%) rename apps/web/app/{ => (use-page-wrapper)}/insights/routing/page.tsx (100%) rename apps/web/app/{ => (use-page-wrapper)}/insights/virtual-queues/page.tsx (100%) delete mode 100644 apps/web/app/insights/layout.tsx diff --git a/apps/web/modules/insights/layout.tsx b/apps/web/app/(use-page-wrapper)/insights/layout.tsx similarity index 88% rename from apps/web/modules/insights/layout.tsx rename to apps/web/app/(use-page-wrapper)/insights/layout.tsx index 35c3f386e7f39d..df6bd32be650d7 100644 --- a/apps/web/modules/insights/layout.tsx +++ b/apps/web/app/(use-page-wrapper)/insights/layout.tsx @@ -1,18 +1,17 @@ "use client"; -import type { ReactElement } from "react"; +import { useSession } from "next-auth/react"; import Shell from "@calcom/features/shell/Shell"; import { UpgradeTip } from "@calcom/features/tips"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; -import { trpc } from "@calcom/trpc"; import { Button, ButtonGroup } from "@calcom/ui"; import { Icon } from "@calcom/ui"; export default function InsightsLayout({ children }: { children: React.ReactNode }) { const { t } = useLocale(); - const { data: user } = trpc.viewer.me.useQuery(); + const session = useSession(); const features = [ { @@ -59,11 +58,9 @@ export default function InsightsLayout({ children }: { children: React.ReactNode }> - {!user ? null : children} + {!session.data?.user ? null : children} ); } - -export const getInsightsLayout = (page: ReactElement) => {page}; diff --git a/apps/web/app/insights/page.tsx b/apps/web/app/(use-page-wrapper)/insights/page.tsx similarity index 100% rename from apps/web/app/insights/page.tsx rename to apps/web/app/(use-page-wrapper)/insights/page.tsx diff --git a/apps/web/app/insights/routing/page.tsx b/apps/web/app/(use-page-wrapper)/insights/routing/page.tsx similarity index 100% rename from apps/web/app/insights/routing/page.tsx rename to apps/web/app/(use-page-wrapper)/insights/routing/page.tsx diff --git a/apps/web/app/insights/virtual-queues/page.tsx b/apps/web/app/(use-page-wrapper)/insights/virtual-queues/page.tsx similarity index 100% rename from apps/web/app/insights/virtual-queues/page.tsx rename to apps/web/app/(use-page-wrapper)/insights/virtual-queues/page.tsx diff --git a/apps/web/app/insights/layout.tsx b/apps/web/app/insights/layout.tsx deleted file mode 100644 index ad256d0356ccd3..00000000000000 --- a/apps/web/app/insights/layout.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { WithLayout } from "app/layoutHOC"; - -import { getInsightsLayout } from "~/insights/layout"; - -export default WithLayout({ getLayout: getInsightsLayout });