fix: call history to free users (#27473)
* fix: call history to free users Signed-off-by: Jagadish Madavalkar <[email protected]> * bypass paywall for insights/call-history * improve naming --------- Signed-off-by: Jagadish Madavalkar <[email protected]> Co-authored-by: Romit <[email protected]> Co-authored-by: Romit <[email protected]>
This commit is contained in:
2 files changed
+19
-5
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user