The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add new badge
Steven Tey24de79b4091d
diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsxindex 38a788a454..36e9063f9c 100644--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx@@ -217,6 +217,7 @@ const NAV_AREAS: SidebarNavAreas<SidebarNavData> = {name: "Analytics",icon: LinesYStatic,href: `/${slug}/program/analytics`,+ badge: "New",},{name: "Commissions",diff --git a/apps/web/ui/layout/sidebar/sidebar-nav.tsx b/apps/web/ui/layout/sidebar/sidebar-nav.tsxindex e467128491..fd7b6e2b88 100644--- a/apps/web/ui/layout/sidebar/sidebar-nav.tsx+++ b/apps/web/ui/layout/sidebar/sidebar-nav.tsx@@ -26,6 +26,7 @@ export type NavItemCommon = {href: `/${string}`;exact?: boolean;isActive?: (pathname: string, href: string) => boolean;+ badge?: string;};export type NavSubItemType = NavItemCommon;@@ -92,7 +93,7 @@ export function SidebarNav<T extends Record<any, any>>({<nav className="grid size-full grid-cols-[64px_1fr]"><div className="flex flex-col items-center justify-between"><div className="flex flex-col items-center p-2">- <div className="pt-2 pb-1">+ <div className="pb-1 pt-2"><Linkhref="/"className="block rounded-lg px-1 py-4 outline-none transition-opacity focus-visible:ring-2 focus-visible:ring-black/50"@@ -330,30 +331,42 @@ function NavItem({ item }: { item: NavItemType | NavSubItemType }) {onPointerEnter={() => setHovered(true)}onPointerLeave={() => setHovered(false)}className={cn(- "text-content-default group flex items-center gap-2.5 rounded-lg p-2 text-sm leading-none transition-[background-color,color,font-weight] duration-75",+ "text-content-default group flex items-center justify-between rounded-lg p-2 text-sm leading-none transition-[background-color,color,font-weight] duration-75","outline-none focus-visible:ring-2 focus-visible:ring-black/50",isActive && !items? "bg-blue-100/50 font-medium text-blue-600 hover:bg-blue-100/80 active:bg-blue-100": "hover:bg-bg-inverted/5 active:bg-bg-inverted/10",)}>- {Icon && (- <Icon- className={cn(- "size-4",- !items && "group-data-[active=true]:text-blue-600",- )}- data-hovered={hovered}- />- )}- {name}- {items && (- <div className="flex grow justify-end">- {items ? (- <ChevronDown className="size-3.5 text-neutral-500 transition-transform duration-75 group-data-[active=true]:rotate-180" />- ) : null}- </div>- )}+ <span className="flex items-center gap-2.5">+ {Icon && (+ <Icon+ className={cn(+ "size-4",+ !items && "group-data-[active=true]:text-blue-600",+ )}+ data-hovered={hovered}+ />+ )}+ {name}+ </span>+ <span className="ml-2 flex items-center gap-2">+ {"badge" in item && item.badge && (+ <span+ className={cn(+ "flex items-center justify-center rounded px-1.5 py-0.5 text-xs font-semibold",+ isActive && !items+ ? "bg-blue-600 text-white"+ : "bg-blue-100 text-blue-600",+ )}+ >+ {item.badge}+ </span>+ )}+ {items && (+ <ChevronDown className="size-3.5 text-neutral-500 transition-transform duration-75 group-data-[active=true]:rotate-180" />+ )}+ </span></Link>{items && (<AnimatedSizeContainer