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.

add demo data

Steven Tey33070936750f
diff --git a/apps/web/lib/referrals/index.ts b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/constants.ts
similarity index 100%
rename from apps/web/lib/referrals/index.ts
rename to apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/constants.ts
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/stats.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/stats.tsx
index bf959ebc55..9e33234c5d 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/stats.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/referrals/stats.tsx
@@ -40,11 +40,26 @@ async function StatsInner({ slug }: { slug: string }) {
if (!link) {
return (
<>
- <StatsCard label="Affiliate Earnings" demo>
+ <StatsCard
+ label="Affiliate Earnings"
+ demo
+ graphic={<MiniAreaChart data={[]} />}
+ >
$60
</StatsCard>
- <StatsCard label="Clicks Quota Earned" demo>
- 500
+ <StatsCard
+ label="Clicks Quota Earned"
+ demo
+ graphic={
+ <Gauge value={2500} max={REFERRAL_CLICKS_QUOTA_BONUS_MAX}>
+ <div className="flex items-end gap-1 text-xs font-medium text-gray-500">
+ <User className="size-4" />
+ <CountingNumbers>5</CountingNumbers>
+ </div>
+ </Gauge>
+ }
+ >
+ 2500
</StatsCard>
</>
);
@@ -121,7 +136,7 @@ async function loadData(linkId: string) {
date: new Date(d.start),
value: d.amount,
})),
- referredSignups: totalEvents.leads,
+ referredSignups: Math.min(totalEvents.leads, 32),
clicksQuotaBonus: Math.min(
totalEvents.leads * REFERRAL_CLICKS_QUOTA_BONUS,
REFERRAL_CLICKS_QUOTA_BONUS_MAX,
diff --git a/packages/blocks/src/stats-card.tsx b/packages/blocks/src/stats-card.tsx
index b84bb94360..f0726c2e0d 100644
--- a/packages/blocks/src/stats-card.tsx
+++ b/packages/blocks/src/stats-card.tsx
@@ -1,4 +1,3 @@
-import { cn } from "@dub/utils";
import { PropsWithChildren, ReactNode } from "react";
const wrapperClassName =
@@ -20,14 +19,14 @@ export function StatsCard({
<span className="truncate whitespace-nowrap text-sm text-gray-600">
{label}
</span>
- <span
- className={cn(
- "text-2xl font-medium",
- demo && "text-gray-500 blur-[4px]",
+ <div className="flex items-center gap-2">
+ <span className="text-2xl font-medium">{children}</span>
+ {demo && (
+ <span className="rounded-full border border-gray-500 px-1 py-px text-[9px] text-gray-500">
+ DEMO DATA
+ </span>
)}
- >
- {children}
- </span>
+ </div>
</div>
{graphic && (
<div className="relative flex h-full min-w-0 max-w-[140px] grow items-center justify-end">