The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Add invitations empty state
Tim Wilson52767d31b105
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/invitations/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/invitations/page-client.tsxindex ba67652ac9..ca636d401c 100644--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/invitations/page-client.tsx+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/invitations/page-client.tsx@@ -4,8 +4,8 @@ import useProgramEnrollments from "@/lib/swr/use-program-enrollments";import { PageWidthWrapper } from "@/ui/layout/page-width-wrapper";import { ProgramCardSkeleton } from "@/ui/partners/program-card";import { ProgramInviteCard } from "@/ui/partners/program-invite-card";-import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";-import { CircleDollar, GridIcon } from "@dub/ui/icons";+import { SimpleEmptyState } from "@/ui/shared/simple-empty-state";+import { HexadecagonStar } from "@dub/ui/icons";export function ProgramInvitationsPageClient() {const { programEnrollments, isLoading } = useProgramEnrollments({@@ -15,20 +15,20 @@ export function ProgramInvitationsPageClient() {return (<PageWidthWrapper className="pb-10">- {programEnrollments?.length == 0 ? (- <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-neutral-500">- <CircleDollar className="size-3.5" />+ {programEnrollments?.length == 1 ? (+ <SimpleEmptyState+ title="No program invitations"+ description="When a program sends you an invitation to join them, they will appear here."+ graphic={+ <div className="border-border-subtle flex flex-col gap-4 rounded-xl border p-3 shadow-[0_4px_12px_#0001]">+ <HexadecagonStar className="text-content-default size-6" />+ <div className="flex flex-col gap-2">+ <div className="bg-bg-emphasis h-2.5 w-8 rounded" />+ <div className="bg-bg-emphasis h-2.5 w-16 rounded" /></div>- </>+ <div className="bg-bg-inverted h-5 w-40 max-w-full rounded bg-neutral-800"></div>+ </div>}- learnMoreHref="https://d.to/conversions"/>) : (<div className="@md/page:grid-cols-2 @3xl/page:grid-cols-3 grid gap-4">diff --git a/apps/web/ui/shared/simple-empty-state.tsx b/apps/web/ui/shared/simple-empty-state.tsxnew file mode 100644index 0000000000..1711f8c756--- /dev/null+++ b/apps/web/ui/shared/simple-empty-state.tsx@@ -0,0 +1,62 @@+"use client";++import { Badge, buttonVariants } from "@dub/ui";+import { cn } from "@dub/utils";+import Link from "next/link";+import { ReactNode } from "react";++export function SimpleEmptyState({+ title,+ description,+ graphic,+ addButton,+ pillContent,+ learnMoreHref,+ learnMoreClassName,+ learnMoreText,+ className,+}: {+ title: string;+ description: string;+ graphic?: ReactNode;+ addButton?: ReactNode;+ pillContent?: string;+ learnMoreHref?: string;+ learnMoreClassName?: string;+ learnMoreText?: string;+ className?: string;+}) {+ return (+ <div+ className={cn(+ "flex flex-col items-center justify-center gap-6 px-4 py-10 md:min-h-[calc(100vh-10rem)]",+ className,+ )}+ >+ {graphic && <div className="flex flex-col items-center">{graphic}</div>}+ {pillContent && <Badge variant="blueGradient">{pillContent}</Badge>}+ <div className="max-w-[350px] text-pretty text-center">+ <span className="text-base font-medium text-neutral-900">{title}</span>+ <p className="mt-2 text-pretty text-sm text-neutral-500">+ {description}+ </p>+ </div>+ <div className="flex items-center gap-2">+ {addButton}+ {learnMoreHref && (+ <Link+ href={learnMoreHref}+ target="_blank"+ className={cn(+ buttonVariants({ variant: addButton ? "secondary" : "primary" }),+ "flex h-9 items-center whitespace-nowrap rounded-lg border px-4 text-sm",+ learnMoreClassName,+ )}+ >+ {learnMoreText || "Learn more"}+ </Link>+ )}+ </div>+ </div>+ );+}