Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

show hide the button

Kiran K97a904008630
diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
index c578a35f80..0210d480e4 100644
--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
@@ -1,5 +1,6 @@
"use client";
+import useCustomersCount from "@/lib/swr/use-customers-count";
import useWorkspace from "@/lib/swr/use-workspace";
import { useRouterStuff } from "@dub/ui";
import {
@@ -52,6 +53,7 @@ type SidebarNavData = {
session?: Session | null;
showNews?: boolean;
applicationsCount?: number;
+ showConversionGuides?: boolean;
};
const FIVE_YEARS_SECONDS = 60 * 60 * 24 * 365 * 5;
@@ -393,7 +395,7 @@ export function AppSidebarNav({
const pathname = usePathname();
const { getQueryString } = useRouterStuff();
const { data: session } = useSession();
- const { defaultProgramId } = useWorkspace();
+ const { defaultProgramId, conversionEnabled } = useWorkspace();
const currentArea = useMemo(() => {
return pathname.startsWith("/account/settings")
@@ -409,6 +411,10 @@ export function AppSidebarNav({
enabled: currentArea === "program",
});
+ const { data: customersCount } = useCustomersCount({
+ enabled: conversionEnabled === true,
+ });
+
return (
<SidebarNav
groups={NAV_GROUPS}
@@ -424,6 +430,7 @@ export function AppSidebarNav({
showNews: pathname.startsWith(`/${slug}/program`) ? false : true,
defaultProgramId: defaultProgramId || undefined,
applicationsCount,
+ showConversionGuides: conversionEnabled && customersCount === 0,
}}
toolContent={toolContent}
newsContent={newsContent}
diff --git a/apps/web/ui/layout/sidebar/sidebar-nav.tsx b/apps/web/ui/layout/sidebar/sidebar-nav.tsx
index d93b353ace..4afed5cdeb 100644
--- a/apps/web/ui/layout/sidebar/sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/sidebar-nav.tsx
@@ -172,15 +172,19 @@ export function SidebarNav<T extends Record<any, any>>({
<div className="-mx-3 flex grow flex-col justify-end">
<div className="flex flex-col gap-4 divide-y divide-neutral-200">
- <div className="flex w-full items-center justify-center">
- <Link
- href={`/${data.slug}/tracking-guide`}
- className="flex h-8 items-center gap-3 rounded-lg bg-neutral-900/10 px-2.5 py-2 text-sm font-medium text-neutral-700 hover:bg-neutral-900/20"
- >
- <BookOpen className="size-4" />
- View connection guides
- </Link>
- </div>
+ {data.showConversionGuides && (
+ <div className="flex w-full items-center justify-center">
+ <Link
+ href={`/${data.slug}/tracking-guide`}
+ className="flex h-8 items-center gap-3 rounded-lg bg-neutral-900/10 px-2.5 py-2 text-sm font-medium text-neutral-700 hover:bg-neutral-900/20"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ <BookOpen className="size-4" />
+ View connection guides
+ </Link>
+ </div>
+ )}
<div>
<AnimatePresence>