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.

Nav fixes

Tim Wilsonbc9d88e2654f
diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
index 6a22d39c24..41c8a823a7 100644
--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx
@@ -56,10 +56,12 @@ const NAV_GROUPS: SidebarNavGroups<SidebarNavData> = ({
"Create, organize, and measure the performance of your short links.",
learnMoreHref: "https://dub.co/links",
icon: Compass,
- href: `/${slug}/links${pathname === `/${slug}/links` ? "" : queryString}`,
+ href: slug ? `/${slug}/links` : "/links",
active:
+ !!slug &&
pathname.startsWith(`/${slug}`) &&
- !pathname.startsWith(`/${slug}/program`),
+ !pathname.startsWith(`/${slug}/program`) &&
+ !pathname.startsWith(`/${slug}/settings`),
onClick: () => {
document.cookie = `dub_product:${slug}=links;path=/;max-age=${FIVE_YEARS_SECONDS}`;
@@ -71,7 +73,7 @@ const NAV_GROUPS: SidebarNavGroups<SidebarNavData> = ({
"Manage your partner program, performance, partners, and payouts.",
learnMoreHref: "https://dub.co/partners",
icon: ConnectedDots4,
- href: `/${slug}/program`,
+ href: slug ? `/${slug}/program` : "/program",
active: pathname.startsWith(`/${slug}/program`),
onClick: defaultProgramId
diff --git a/apps/web/ui/layout/sidebar/sidebar-nav.tsx b/apps/web/ui/layout/sidebar/sidebar-nav.tsx
index 4e45fda881..9ac85b59d8 100644
--- a/apps/web/ui/layout/sidebar/sidebar-nav.tsx
+++ b/apps/web/ui/layout/sidebar/sidebar-nav.tsx
@@ -88,7 +88,7 @@ export function SidebarNav<T extends Record<any, any>>({
<div className="flex flex-col items-center justify-between">
<div className="flex flex-col items-center p-2">
<Link
- href=""
+ href="/"
className="rounded-md px-1 py-[18px] outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-black/50"
>
<NavWordmark className="h-5" isInApp />