From 39135f84eff377051168e91a7663c250f9e3340c Mon Sep 17 00:00:00 2001 From: Jagadish Madavalkar <106825425+jagadish-7@users.noreply.github.com> Date: Fri, 6 Feb 2026 15:41:01 +0530 Subject: [PATCH] fix: call history to free users (#27473) * fix: call history to free users Signed-off-by: Jagadish Madavalkar * bypass paywall for insights/call-history * improve naming --------- Signed-off-by: Jagadish Madavalkar Co-authored-by: Romit <85230081+romitg2@users.noreply.github.com> Co-authored-by: Romit --- .../insights/UpgradeTipWrapper.tsx | 7 +++++++ .../web/modules/shell/navigation/Navigation.tsx | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/apps/web/app/(use-page-wrapper)/insights/UpgradeTipWrapper.tsx b/apps/web/app/(use-page-wrapper)/insights/UpgradeTipWrapper.tsx index e3d8ecd549..2bc0756255 100644 --- a/apps/web/app/(use-page-wrapper)/insights/UpgradeTipWrapper.tsx +++ b/apps/web/app/(use-page-wrapper)/insights/UpgradeTipWrapper.tsx @@ -1,6 +1,7 @@ "use client"; import { useSession } from "next-auth/react"; +import { usePathname } from "next/navigation"; import { WEBAPP_URL } from "@calcom/lib/constants"; import { useLocale } from "@calcom/lib/hooks/useLocale"; @@ -13,6 +14,12 @@ import { UpgradeTip } from "~/shell/UpgradeTip"; export default function UpgradeTipWrapper({ children }: { children: React.ReactNode }) { const { t } = useLocale(); const session = useSession(); + const pathname = usePathname(); + + if (pathname?.startsWith("/insights/call-history")) { + return !session.data?.user ? null : <>{children}; + } + const features = [ { icon: , diff --git a/apps/web/modules/shell/navigation/Navigation.tsx b/apps/web/modules/shell/navigation/Navigation.tsx index 62b71a81e1..ed436401b5 100644 --- a/apps/web/modules/shell/navigation/Navigation.tsx +++ b/apps/web/modules/shell/navigation/Navigation.tsx @@ -20,7 +20,7 @@ export const MORE_SEPARATOR_NAME = "more"; const getNavigationItems = ( orgBranding: OrganizationBranding, - hasInsightsAccess: boolean + hasAllInsightsAccess: boolean ): NavigationItemType[] => [ { name: "event_types_page_title", @@ -111,7 +111,7 @@ const getNavigationItems = ( icon: "chart-bar", isCurrent: ({ pathname: path, item }) => path?.startsWith(item.href) ?? false, moreOnMobile: true, - child: hasInsightsAccess + child: hasAllInsightsAccess ? [ { name: "bookings", @@ -135,7 +135,14 @@ const getNavigationItems = ( isCurrent: ({ pathname: path }) => path?.startsWith("/insights/call-history") ?? false, }, ] - : undefined, + : [ + { + name: "call_history", + href: "/insights/call-history", + // icon: "phone", + isCurrent: ({ pathname: path }) => path?.startsWith("/insights/call-history") ?? false, + } + ], }, ]; @@ -193,9 +200,9 @@ const useNavigationItems = (isPlatformNavigation = false) => { const orgBranding = useOrgBranding(); const { hasPaidPlan, isPending } = useHasPaidPlan(); return useMemo(() => { - const hasInsightsAccess = !isPending && !!hasPaidPlan; + const hasAllInsightsAccess = !isPending && !!hasPaidPlan; const items = !isPlatformNavigation - ? getNavigationItems(orgBranding, hasInsightsAccess) + ? getNavigationItems(orgBranding, hasAllInsightsAccess) : platformNavigationItems; const desktopNavigationItems = items.filter((item) => item.name !== MORE_SEPARATOR_NAME);