feat: add upgrade banners for teams and organizations (#27650)
This commit is contained in:
1 parent
c197de147a
commit
b7340f7151
74 files changed
+1834
-500
No files matched your search
@@ -20,8 +20,7 @@ import { NavigationItem, MobileNavigationItem, MobileNavigationMoreItem } from "
|
||||
export const MORE_SEPARATOR_NAME = "more";
|
||||
|
||||
const getNavigationItems = (
|
||||
orgBranding: OrganizationBranding,
|
||||
hasAllInsightsAccess: boolean
|
||||
orgBranding: OrganizationBranding
|
||||
): NavigationItemType[] => [
|
||||
{
|
||||
name: "event_types_page_title",
|
||||
@@ -112,8 +111,7 @@ const getNavigationItems = (
|
||||
icon: "chart-bar",
|
||||
isCurrent: ({ pathname: path, item }) => path?.startsWith(item.href) ?? false,
|
||||
moreOnMobile: true,
|
||||
child: hasAllInsightsAccess
|
||||
? [
|
||||
child: [
|
||||
{
|
||||
name: "bookings",
|
||||
href: "/insights",
|
||||
@@ -141,14 +139,6 @@ const getNavigationItems = (
|
||||
isCurrent: ({ pathname: path }) => path?.startsWith("/insights/wrong-routing") ?? false,
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
name: "call_history",
|
||||
href: "/insights/call-history",
|
||||
// icon: "phone",
|
||||
isCurrent: ({ pathname: path }) => path?.startsWith("/insights/call-history") ?? false,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -206,9 +196,8 @@ const useNavigationItems = (isPlatformNavigation = false) => {
|
||||
const orgBranding = useOrgBranding();
|
||||
const { hasPaidPlan, isPending } = useHasPaidPlan();
|
||||
return useMemo(() => {
|
||||
const hasAllInsightsAccess = !isPending && !!hasPaidPlan;
|
||||
const items = !isPlatformNavigation
|
||||
? getNavigationItems(orgBranding, hasAllInsightsAccess)
|
||||
? getNavigationItems(orgBranding)
|
||||
: platformNavigationItems;
|
||||
|
||||
const desktopNavigationItems = items.filter((item) => item.name !== MORE_SEPARATOR_NAME);
|
||||
|
||||
Reference in new issue
Block a user