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.

Disable filtering by UTM tags

Tim Wilsonb84229098c5f
diff --git a/apps/web/ui/analytics/bar-list.tsx b/apps/web/ui/analytics/bar-list.tsx
index 044ae2d6ea..a48682dae6 100644
--- a/apps/web/ui/analytics/bar-list.tsx
+++ b/apps/web/ui/analytics/bar-list.tsx
@@ -33,7 +33,7 @@ export default function BarList({
data: {
icon: ReactNode;
title: string;
- href: string;
+ href?: string;
value: number;
linkId?: string;
}[];
@@ -117,7 +117,7 @@ export function LineItem({
}: {
icon: ReactNode;
title: string;
- href: string;
+ href?: string;
value: number;
maxValue: number;
tab: string;
@@ -140,12 +140,20 @@ export function LineItem({
const { saleUnit } = useContext(AnalyticsContext);
+ const As = href ? Link : "div";
+
return (
- <Link
- href={href}
- scroll={false}
- onClick={() => setShowModal(false)}
- className={`border-l-2 border-transparent px-4 py-1 ${hoverBackground} min-w-0 transition-all`}
+ // @ts-ignore - we know if it's a Link it'll get its href
+ <As
+ {...(href && {
+ href,
+ scroll: false,
+ onClick: () => setShowModal(false),
+ })}
+ className={cn(
+ `min-w-0 border-l-2 border-transparent px-4 py-1 transition-all`,
+ href && hoverBackground,
+ )}
>
<div className="group flex items-center justify-between">
<div className="relative z-10 flex h-8 w-full min-w-0 max-w-[calc(100%-2rem)] items-center">
@@ -198,6 +206,6 @@ export function LineItem({
}
/>
</div>
- </Link>
+ </As>
);
}
diff --git a/apps/web/ui/analytics/referer.tsx b/apps/web/ui/analytics/referer.tsx
index d4d6f64498..b97d0c10e6 100644
--- a/apps/web/ui/analytics/referer.tsx
+++ b/apps/web/ui/analytics/referer.tsx
@@ -80,16 +80,19 @@ export default function Referer() {
/>
),
title: d[singularTabName],
- href: queryParams({
- ...(searchParams.has(singularTabName)
- ? { del: singularTabName }
- : {
- set: {
- [singularTabName]: d[singularTabName],
- },
- }),
- getNewPath: true,
- }) as string,
+ href:
+ tab === "utms"
+ ? undefined
+ : (queryParams({
+ ...(searchParams.has(singularTabName)
+ ? { del: singularTabName }
+ : {
+ set: {
+ [singularTabName]: d[singularTabName],
+ },
+ }),
+ getNewPath: true,
+ }) as string),
value: d[dataKey] || 0,
}))
?.sort((a, b) => b.value - a.value) || []