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.

small improvements

Steven Tey05b261139294
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/earnings-chart.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/earnings-chart.tsx
index fab9f753fd..d86af3c1d5 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/earnings-chart.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/earnings-chart.tsx
@@ -4,7 +4,6 @@ import { formatDateTooltip } from "@/lib/analytics/format-date-tooltip";
import { testIds } from "@/lib/e2e/test-ids";
import { usePartnerProfileEarningsTimeseries } from "@/lib/swr/use-partner-profile-earnings";
import useProgramEnrollments from "@/lib/swr/use-program-enrollments";
-import { buttonVariants } from "@dub/ui";
import {
Areas,
ChartContext,
@@ -13,7 +12,7 @@ import {
YAxis,
} from "@dub/ui/charts";
import { LoadingSpinner } from "@dub/ui/icons";
-import { cn, currencyFormatter, nFormatter } from "@dub/utils";
+import { currencyFormatter, nFormatter } from "@dub/utils";
import NumberFlow from "@number-flow/react";
import { LinearGradient } from "@visx/gradient";
import { useRouter } from "next/navigation";
@@ -130,49 +129,44 @@ export function EarningsChart() {
return (
<div className="text-[11px] leading-[1.1]">
- <div className="border-b border-neutral-200 p-3 font-semibold text-neutral-900">
- {formatDateTooltip(d.date, { interval, start, end })}
+ <div className="flex items-center justify-between gap-3 border-b border-neutral-200 p-3">
+ <span className="font-semibold text-neutral-900">
+ {formatDateTooltip(d.date, { interval, start, end })}
+ </span>
+ <span className="shrink-0 font-semibold text-neutral-900">
+ {currencyFormatter(d.values.main)}
+ </span>
</div>
- <div className="flex flex-col gap-3 p-3">
+ <div className="flex flex-col gap-2 p-3">
{programEarnings.length > 0 ? (
- <div className="flex flex-col gap-2">
- {programEarnings.map(([programId, earnings]) => {
- const program = programs.get(programId);
+ programEarnings.map(([programId, earnings]) => {
+ const program = programs.get(programId);
- return (
- <div
- key={programId}
- className="flex items-center justify-between gap-2"
- >
- <div className="flex min-w-0 items-center gap-2">
- {program && (
- <ProgramLogo
- program={program}
- className="size-3.5"
- />
- )}
- <span className="truncate font-medium text-neutral-700">
- {program?.name ?? programId}
- </span>
- </div>
- <span className="shrink-0 text-neutral-500">
- {currencyFormatter(earnings)}
+ return (
+ <div
+ key={programId}
+ className="flex items-center justify-between gap-2"
+ >
+ <div className="flex min-w-0 items-center gap-2">
+ {program && (
+ <ProgramLogo
+ program={program}
+ className="size-3.5"
+ />
+ )}
+ <span className="truncate font-medium text-neutral-700">
+ {program?.name ?? programId}
</span>
</div>
- );
- })}
- </div>
+ <span className="shrink-0 text-neutral-500">
+ {currencyFormatter(earnings)}
+ </span>
+ </div>
+ );
+ })
) : (
<span className="text-neutral-500">No earnings</span>
)}
- <div
- className={cn(
- buttonVariants({ variant: "secondary" }),
- "flex h-6 items-center justify-center rounded-lg border text-sm font-medium",
- )}
- >
- View all programs
- </div>
</div>
</div>
);
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/recent-earnings-card.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/recent-earnings-card.tsx
index 1669fbd2f6..dcac7b542f 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/recent-earnings-card.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/recent-earnings-card.tsx
@@ -6,7 +6,8 @@ import { CommissionTypeIcon } from "@/ui/partners/comission-type-icon";
import { CommissionStatusBadges } from "@/ui/partners/commission-status-badges";
import { StatusBadge } from "@dub/ui";
import { InvoiceDollar } from "@dub/ui/icons";
-import { currencyFormatter, formatDate } from "@dub/utils";
+import { cn, currencyFormatter, formatDate } from "@dub/utils";
+import Link from "next/link";
import {
OVERVIEW_CARD_ROW_CLASSNAME,
OverviewCard,
@@ -44,7 +45,13 @@ export function RecentEarningsCard() {
const badge = CommissionStatusBadges[earning.status];
return (
- <div className={OVERVIEW_CARD_ROW_CLASSNAME}>
+ <Link
+ href={`/programs/${earning.program.slug}`}
+ className={cn(
+ OVERVIEW_CARD_ROW_CLASSNAME,
+ "transition-colors duration-100 hover:bg-neutral-50 active:bg-neutral-100",
+ )}
+ >
<ProgramLogo program={earning.program} />
<CommissionTypeIcon type={earning.type} className="shrink-0" />
<span className="text-content-emphasis min-w-0 grow truncate text-xs font-semibold">
@@ -58,7 +65,7 @@ export function RecentEarningsCard() {
<span className="w-16 shrink-0 text-right text-xs font-medium text-neutral-500">
{currencyFormatter(earning.earnings)}
</span>
- </div>
+ </Link>
);
}}
/>
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/top-links-card.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/top-links-card.tsx
index 0222ae3672..d2969e84c3 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/top-links-card.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/overview/top-links-card.tsx
@@ -3,7 +3,8 @@
import { testIds } from "@/lib/e2e/test-ids";
import { usePartnerProfileTopEarnings } from "@/lib/swr/use-partner-profile-earnings";
import { Hyperlink } from "@dub/ui/icons";
-import { currencyFormatter, getPrettyUrl } from "@dub/utils";
+import { cn, currencyFormatter, getPrettyUrl } from "@dub/utils";
+import Link from "next/link";
import {
OVERVIEW_CARD_ROW_CLASSNAME,
OverviewCard,
@@ -39,7 +40,13 @@ export function TopLinksCard() {
title: "No earnings in this date range",
}}
renderItem={(link) => (
- <div className={OVERVIEW_CARD_ROW_CLASSNAME}>
+ <Link
+ href={`/programs/${link.program.slug}`}
+ className={cn(
+ OVERVIEW_CARD_ROW_CLASSNAME,
+ "transition-colors duration-100 hover:bg-neutral-50 active:bg-neutral-100",
+ )}
+ >
<ProgramLogo program={link.program} />
<span
className="text-content-emphasis min-w-0 grow truncate text-xs font-semibold"
@@ -50,7 +57,7 @@ export function TopLinksCard() {
<span className="shrink-0 text-xs font-medium text-neutral-500">
{currencyFormatter(link.earnings)}
</span>
- </div>
+ </Link>
)}
/>
</OverviewCard>