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 Resources empty state

Tim Wilson08c58595450a
diff --git a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/resources/page-client.tsx b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/resources/page-client.tsx
new file mode 100644
index 0000000000..05a25615df
--- /dev/null
+++ b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/resources/page-client.tsx
@@ -0,0 +1,28 @@
+"use client";
+
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
+import { MaxWidthWrapper } from "@dub/ui";
+import { FileZip2, Palette2, Post } from "@dub/ui/src/icons";
+
+const emptyStateIcons = [Post, Palette2, FileZip2];
+
+export function ResourcesPageClient() {
+ return (
+ <MaxWidthWrapper>
+ <AnimatedEmptyState
+ title="Resources"
+ description="Partner guides and materials to boost promotion and earnings"
+ cardContent={(idx) => {
+ const Icon = emptyStateIcons[idx % emptyStateIcons.length];
+ return (
+ <>
+ <Icon className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ </>
+ );
+ }}
+ pillContent="Coming soon"
+ />
+ </MaxWidthWrapper>
+ );
+}
diff --git a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/resources/page.tsx b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/resources/page.tsx
index bd317c0442..6c13c18c9c 100644
--- a/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/resources/page.tsx
+++ b/apps/web/app/partners.dub.co/(dashboard)/[partnerId]/[programId]/resources/page.tsx
@@ -1,5 +1,10 @@
import { PageContent } from "@/ui/layout/page-content";
+import { ResourcesPageClient } from "./page-client";
export default function ResourcesPage() {
- return <PageContent title="Resources"></PageContent>;
+ return (
+ <PageContent title="Resources">
+ <ResourcesPageClient />
+ </PageContent>
+ );
}
diff --git a/apps/web/ui/shared/animated-empty-state.tsx b/apps/web/ui/shared/animated-empty-state.tsx
index 21c41c6343..6780982882 100644
--- a/apps/web/ui/shared/animated-empty-state.tsx
+++ b/apps/web/ui/shared/animated-empty-state.tsx
@@ -17,7 +17,7 @@ export function AnimatedEmptyState({
}: {
title: string;
description: string;
- cardContent: ReactNode;
+ cardContent: ReactNode | ((index: number) => ReactNode);
addButton?: ReactNode;
pillContent?: string;
learnMoreHref?: string;
@@ -37,7 +37,11 @@ export function AnimatedEmptyState({
className="animate-infinite-scroll-y flex flex-col [animation-duration:10s]"
>
{[...Array(6)].map((_, idx) => (
- <Card key={idx}>{cardContent}</Card>
+ <Card key={idx}>
+ {typeof cardContent === "function"
+ ? cardContent(idx % 3)
+ : cardContent}
+ </Card>
))}
</div>
</div>
diff --git a/packages/ui/src/icons/nucleo/color-palette2.tsx b/packages/ui/src/icons/nucleo/color-palette2.tsx
new file mode 100644
index 0000000000..52985e2d1c
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/color-palette2.tsx
@@ -0,0 +1,42 @@
+import { SVGProps } from "react";
+
+export function ColorPalette2(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <path
+ d="M6.591,14.591l6.541-6.541c.391-.391,.391-1.024,0-1.414l-1.768-1.768c-.391-.391-1.024-.391-1.414,0l-.2,.2"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="M5,15.25H14.25c.552,0,1-.448,1-1v-2.5c0-.552-.448-1-1-1h-.283"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="M5,2.75h0c1.242,0,2.25,1.008,2.25,2.25V14.25c0,.552-.448,1-1,1H3.75c-.552,0-1-.448-1-1V5c0-1.242,1.008-2.25,2.25-2.25Z"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ transform="translate(10 18) rotate(180)"
+ />
+ <circle cx="5" cy="13" fill="currentColor" r=".75" stroke="none" />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/file-zip2.tsx b/packages/ui/src/icons/nucleo/file-zip2.tsx
new file mode 100644
index 0000000000..7063b30f17
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/file-zip2.tsx
@@ -0,0 +1,64 @@
+import { SVGProps } from "react";
+
+export function FileZip2(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <path
+ d="M2.75,14.25V3.75c0-1.105,.895-2,2-2h5.586c.265,0,.52,.105,.707,.293l3.914,3.914c.188,.188,.293,.442,.293,.707v7.586c0,1.105-.895,2-2,2H4.75c-1.105,0-2-.895-2-2Z"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <path
+ d="M15.16,6.25h-3.41c-.552,0-1-.448-1-1V1.852"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <rect
+ height="1.5"
+ width="2"
+ fill="currentColor"
+ stroke="none"
+ x="5"
+ y="9.5"
+ />
+ <rect
+ height="1.5"
+ width="2"
+ fill="currentColor"
+ stroke="none"
+ x="7"
+ y="11"
+ />
+ <rect
+ height="1.5"
+ width="2"
+ fill="currentColor"
+ stroke="none"
+ x="5"
+ y="12.5"
+ />
+ <rect
+ height="1.5"
+ width="2"
+ fill="currentColor"
+ stroke="none"
+ x="7"
+ y="14"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts
index 908b768b29..bd0509d7a9 100644
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@ -32,6 +32,7 @@ export * from "./circles";
export * from "./circles3";
export * from "./cloud-upload";
export * from "./code";
+export * from "./color-palette2";
export * from "./connected-dots";
export * from "./connected-dots4";
export * from "./connections3";
@@ -47,6 +48,7 @@ export * from "./download";
export * from "./earth-position";
export * from "./eye";
export * from "./eye-slash";
+export * from "./file-zip2";
export * from "./filter-bars";
export * from "./filter2";
export * from "./flag-wavy";
@@ -87,10 +89,12 @@ export * from "./note";
export * from "./office-building";
export * from "./page2";
export * from "./paintbrush";
+export * from "./palette-2";
export * from "./pen-writing";
export * from "./pen2";
export * from "./photo";
export * from "./plus";
+export * from "./post";
export * from "./pyramid";
export * from "./qrcode";
export * from "./receipt2";
diff --git a/packages/ui/src/icons/nucleo/palette-2.tsx b/packages/ui/src/icons/nucleo/palette-2.tsx
new file mode 100644
index 0000000000..c67468a499
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/palette-2.tsx
@@ -0,0 +1,40 @@
+import { SVGProps } from "react";
+
+export function Palette2(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <path
+ d="m8.3034,16.217c-3.7776-.3601-6.7098-3.619-6.5469-7.5271.157-3.7659,3.3501-6.8755,7.1188-6.9388,4.0612-.0683,7.3747,3.2034,7.3747,7.2489h0c0,1.5188-1.2312,2.75-2.75,2.75h-2.963c-1.0336,0-1.6928,1.1036-1.2027,2.0137l.2374.4409c.2597.4823.2062,1.0732-.1361,1.501h0c-.2736.342-.6962.553-1.1322.5115Z"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <circle cx="9" cy="5" fill="currentColor" r="1" strokeWidth="1.5" />
+ <circle
+ cx="6.1716"
+ cy="6.1716"
+ fill="currentColor"
+ r="1"
+ strokeWidth="1.5"
+ />
+ <circle
+ cx="11.8284"
+ cy="6.1716"
+ fill="currentColor"
+ r="1"
+ strokeWidth="1.5"
+ />
+ <circle cx="5" cy="9" fill="currentColor" r="1" strokeWidth="1.5" />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/post.tsx b/packages/ui/src/icons/nucleo/post.tsx
new file mode 100644
index 0000000000..8fd3dbfca4
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/post.tsx
@@ -0,0 +1,52 @@
+import { SVGProps } from "react";
+
+export function Post(props: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ height="18"
+ width="18"
+ viewBox="0 0 18 18"
+ xmlns="http://www.w3.org/2000/svg"
+ {...props}
+ >
+ <g fill="currentColor">
+ <rect
+ height="12.5"
+ width="12.5"
+ fill="none"
+ rx="2"
+ ry="2"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ x="2.75"
+ y="2.75"
+ />
+ <line
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ x1="5.75"
+ x2="9.25"
+ y1="12.25"
+ y2="12.25"
+ />
+ <line
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ x1="5.75"
+ x2="12.25"
+ y1="9.25"
+ y2="9.25"
+ />
+ <circle cx="6" cy="6" fill="currentColor" r="1" strokeWidth="1.5" />
+ </g>
+ </svg>
+ );
+}