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 more empty states

Steven Tey070c092f25e7
diff --git a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/links/page.tsx b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/links/page.tsx
index 723784c109..7a11a2efca 100644
--- a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/links/page.tsx
+++ b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/links/page.tsx
@@ -1,5 +1,35 @@
import { PageContent } from "@/ui/layout/page-content";
-export default function LinksPage() {
- return <PageContent title="Links"></PageContent>;
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
+import {
+ CursorRays,
+ Hyperlink,
+ InvoiceDollar,
+ MaxWidthWrapper,
+ UserCheck,
+} from "@dub/ui";
+
+export default function ProgramLinks() {
+ return (
+ <PageContent title="Links">
+ <MaxWidthWrapper>
+ <AnimatedEmptyState
+ title="Links"
+ description="Create additional partner links and view more details about each one"
+ cardContent={
+ <>
+ <Hyperlink className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ <div className="xs:flex hidden grow items-center justify-end gap-1.5 text-gray-500">
+ <CursorRays className="size-3.5" />
+ <UserCheck className="size-3.5" />
+ <InvoiceDollar className="size-3.5" />
+ </div>
+ </>
+ }
+ pillContent="Coming soon"
+ />
+ </MaxWidthWrapper>
+ </PageContent>
+ );
}
diff --git a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/payouts/page.tsx b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/payouts/page.tsx
index bd4dc1b3b6..10cf955a32 100644
--- a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/payouts/page.tsx
+++ b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/payouts/page.tsx
@@ -1,5 +1,28 @@
import { PageContent } from "@/ui/layout/page-content";
-export default function PayoutsPage() {
- return <PageContent title="Payouts"></PageContent>;
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
+import { Calendar6, MaxWidthWrapper } from "@dub/ui";
+import { Verified } from "lucide-react";
+
+export default function ProgramPayouts() {
+ return (
+ <PageContent title="Payouts">
+ <MaxWidthWrapper>
+ <AnimatedEmptyState
+ title="Payouts"
+ description="Withdraw funds and view your payout history"
+ cardContent={
+ <>
+ <Calendar6 className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ <div className="xs:flex hidden grow items-center justify-end gap-1.5 text-gray-500">
+ <Verified className="size-3.5" />
+ </div>
+ </>
+ }
+ pillContent="Coming soon"
+ />
+ </MaxWidthWrapper>
+ </PageContent>
+ );
}
diff --git a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/page-client.tsx b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/page-client.tsx
deleted file mode 100644
index 44622a8388..0000000000
--- a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/page-client.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-"use client";
-
-import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
-import { MaxWidthWrapper } from "@dub/ui";
-import { CircleDollar, GridIcon } from "@dub/ui/src/icons";
-
-export function PartnersDashboardClient() {
- return (
- <MaxWidthWrapper>
- <AnimatedEmptyState
- title="No programs found"
- description="Enroll in programs to start earning."
- cardContent={
- <>
- <GridIcon className="size-4 text-neutral-700" />
- <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
- <div className="xs:flex hidden grow items-center justify-end gap-1.5 text-gray-500">
- <CircleDollar className="size-3.5" />
- </div>
- </>
- }
- learnMoreHref="https://dub.co/help/article/dub-conversions"
- />
- </MaxWidthWrapper>
- );
-}
diff --git a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/page.tsx b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/page.tsx
index 0a99f02740..3784033838 100644
--- a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/page.tsx
+++ b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/page.tsx
@@ -1,10 +1,27 @@
import { PageContent } from "@/ui/layout/page-content";
-import { PartnersDashboardClient } from "./page-client";
+
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
+import { CircleDollar, GridIcon, MaxWidthWrapper } from "@dub/ui";
export default function PartnersDashboard() {
return (
<PageContent title="Programs">
- <PartnersDashboardClient />
+ <MaxWidthWrapper>
+ <AnimatedEmptyState
+ title="No programs found"
+ description="Enroll in programs to start earning."
+ cardContent={
+ <>
+ <GridIcon className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ <div className="xs:flex hidden grow items-center justify-end gap-1.5 text-gray-500">
+ <CircleDollar className="size-3.5" />
+ </div>
+ </>
+ }
+ learnMoreHref="https://dub.co/help/article/dub-conversions"
+ />
+ </MaxWidthWrapper>
</PageContent>
);
}
diff --git a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/settings/payouts/page.tsx b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/settings/payouts/page.tsx
index bd4dc1b3b6..ac27f05a1e 100644
--- a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/settings/payouts/page.tsx
+++ b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/settings/payouts/page.tsx
@@ -1,5 +1,25 @@
import { PageContent } from "@/ui/layout/page-content";
-export default function PayoutsPage() {
- return <PageContent title="Payouts"></PageContent>;
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
+import { MaxWidthWrapper } from "@dub/ui";
+import { GreekTemple } from "@dub/ui/src/icons";
+
+export default function PayoutsSettings() {
+ return (
+ <PageContent title="Payouts">
+ <MaxWidthWrapper>
+ <AnimatedEmptyState
+ title="Payouts"
+ description="Connect and manage your bank accounts to receive payouts"
+ cardContent={
+ <>
+ <GreekTemple className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-28 min-w-0 rounded-sm bg-neutral-200" />
+ </>
+ }
+ pillContent="Coming soon"
+ />
+ </MaxWidthWrapper>
+ </PageContent>
+ );
}
diff --git a/apps/web/ui/shared/animated-empty-state.tsx b/apps/web/ui/shared/animated-empty-state.tsx
index b456acadc1..21c41c6343 100644
--- a/apps/web/ui/shared/animated-empty-state.tsx
+++ b/apps/web/ui/shared/animated-empty-state.tsx
@@ -1,4 +1,6 @@
-import { buttonVariants } from "@dub/ui";
+"use client";
+
+import { Badge, buttonVariants } from "@dub/ui";
import { cn } from "@dub/utils";
import Link from "next/link";
import { CSSProperties, PropsWithChildren, ReactNode } from "react";
@@ -8,6 +10,7 @@ export function AnimatedEmptyState({
description,
cardContent,
addButton,
+ pillContent,
learnMoreHref,
learnMoreClassName,
className,
@@ -16,6 +19,7 @@ export function AnimatedEmptyState({
description: string;
cardContent: ReactNode;
addButton?: ReactNode;
+ pillContent?: string;
learnMoreHref?: string;
learnMoreClassName?: string;
className?: string;
@@ -37,9 +41,12 @@ export function AnimatedEmptyState({
))}
</div>
</div>
- <div className="max-w-sm text-pretty text-center">
+ {pillContent && <Badge variant="blueGradient">{pillContent}</Badge>}
+ <div className="max-w-xs text-pretty text-center">
<span className="text-base font-medium text-neutral-900">{title}</span>
- <p className="mt-2 text-sm text-neutral-500">{description}</p>
+ <p className="mt-2 text-pretty text-sm text-neutral-500">
+ {description}
+ </p>
</div>
<div className="flex items-center gap-2">
{addButton}
diff --git a/packages/ui/src/badge.tsx b/packages/ui/src/badge.tsx
index 59aca4154c..1034a54070 100644
--- a/packages/ui/src/badge.tsx
+++ b/packages/ui/src/badge.tsx
@@ -2,7 +2,7 @@ import { cn } from "@dub/utils";
import { cva, type VariantProps } from "class-variance-authority";
const badgeVariants = cva(
- "max-w-fit rounded-full border px-2 py-px text-xs font-medium capitalize whitespace-nowrap",
+ "max-w-fit rounded-full border px-2 py-px text-xs font-medium whitespace-nowrap",
{
variants: {
variant: {
@@ -13,6 +13,8 @@ const badgeVariants = cva(
black: "border-black bg-black text-white",
gray: "border-gray-200 bg-gray-100 text-gray-800",
neutral: "border-gray-400 text-gray-500",
+ blueGradient:
+ "bg-gradient-to-r from-blue-100 via-blue-100/50 to-blue-100 border border-blue-200 text-blue-900",
rainbow:
"bg-gradient-to-r from-violet-600 to-pink-600 text-white border-transparent",
},
diff --git a/packages/ui/src/icons/nucleo/calendar6.tsx b/packages/ui/src/icons/nucleo/calendar6.tsx
new file mode 100644
index 0000000000..b529a7e3c6
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/calendar6.tsx
@@ -0,0 +1,55 @@
+import { SVGProps } from "react";
+
+export function Calendar6(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ {...props}
+ >
+ <g clip-path="url(#clip0_5_25259)">
+ <path
+ d="M5.75 3.25V1.25"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M12.25 3.25V1.25"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M13.75 3.25H4.25C3.14543 3.25 2.25 4.14543 2.25 5.25V13.75C2.25 14.8546 3.14543 15.75 4.25 15.75H13.75C14.8546 15.75 15.75 14.8546 15.75 13.75V5.25C15.75 4.14543 14.8546 3.25 13.75 3.25Z"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M2.25 6.75H15.75"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </g>
+ <defs>
+ <clipPath id="clip0_5_25259">
+ <rect
+ width="18"
+ height="18"
+ fill="white"
+ transform="translate(0 0.5)"
+ />
+ </clipPath>
+ </defs>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/greek-temple.tsx b/packages/ui/src/icons/nucleo/greek-temple.tsx
new file mode 100644
index 0000000000..094cfbda5f
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/greek-temple.tsx
@@ -0,0 +1,61 @@
+import { SVGProps } from "react";
+
+export function GreekTemple(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ fill="none"
+ {...props}
+ >
+ <path
+ d="M2.44434 14.0557H13.5554"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M7.99989 6.94449H12.6666C13.1572 6.94449 13.5554 6.54627 13.5554 6.0556V5.6876C13.5554 5.36583 13.3812 5.06894 13.1012 4.9116L8.43456 2.29827C8.16434 2.14716 7.83545 2.14716 7.56611 2.29827L2.89856 4.91249C2.61767 5.06983 2.44434 5.36671 2.44434 5.68849V6.05649C2.44434 6.54716 2.84256 6.94538 3.33322 6.94538L7.99989 6.94449Z"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M6.44434 14.0556V9.16675"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M3.33325 14.0556V9.16675"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M9.55542 14.0556V9.16675"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M12.6665 14.0556V9.16675"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <path
+ d="M7.99997 5.61115C8.49089 5.61115 8.88886 5.21318 8.88886 4.72226C8.88886 4.23134 8.49089 3.83337 7.99997 3.83337C7.50905 3.83337 7.11108 4.23134 7.11108 4.72226C7.11108 5.21318 7.50905 5.61115 7.99997 5.61115Z"
+ fill="currentColor"
+ />
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts
index 52b7adcf45..908b768b29 100644
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@ -12,6 +12,7 @@ export * from "./books2";
export * from "./box-archive";
export * from "./bullet-list";
export * from "./calendar-days";
+export * from "./calendar6";
export * from "./cards";
export * from "./caret-up-fill";
export * from "./chart-activity2";
@@ -61,6 +62,7 @@ export * from "./globe";
export * from "./globe-pointer";
export * from "./globe-search";
export * from "./globe2";
+export * from "./greek-temple";
export * from "./grid";
export * from "./grid-layout-rows";
export * from "./grid-plus";