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

Tim Wilsond98bc6a5f19c
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/payouts/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/payouts/page-client.tsx
new file mode 100644
index 0000000000..612a507de8
--- /dev/null
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/payouts/page-client.tsx
@@ -0,0 +1,52 @@
+"use client";
+
+import useWorkspace from "@/lib/swr/use-workspace";
+import { useAddBankAccountModal } from "@/ui/modals/add-bank-account-modal";
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
+import { Button } from "@dub/ui";
+import { BadgeCheck, GreekTemple } from "@dub/ui/src/icons";
+import { BankAccount } from "./bank-account";
+import { ComplianceFlow } from "./compliance-flow";
+import { Transactions } from "./transactions";
+import { Wallet } from "./wallet";
+
+export function PayoutsPageClient() {
+ const { bankAccountName, dotsAppId } = useWorkspace();
+
+ const { AddBankAccountModal, setShowAddBankAccountModal } =
+ useAddBankAccountModal();
+
+ return (
+ <>
+ <AddBankAccountModal />
+ {bankAccountName ? (
+ <div className="relative grid gap-5 pb-10">
+ <BankAccount />
+ <ComplianceFlow />
+ <Wallet />
+ <Transactions />
+ </div>
+ ) : (
+ <AnimatedEmptyState
+ title="Payouts"
+ description="Connect financial accounts to authorize partner payouts"
+ cardContent={() => (
+ <>
+ <GreekTemple 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">
+ <BadgeCheck className="size-3.5" />
+ </div>
+ </>
+ )}
+ addButton={
+ <Button
+ text="Connect bank account"
+ onClick={() => setShowAddBankAccountModal(true)}
+ />
+ }
+ />
+ )}
+ </>
+ );
+}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/payouts/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/payouts/page.tsx
index 6537adccb2..ed11e4f461 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/payouts/page.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/payouts/page.tsx
@@ -1,24 +1,14 @@
import LayoutLoader from "@/ui/layout/layout-loader";
import { Suspense } from "react";
-import { BankAccount } from "./bank-account";
-import { ComplianceFlow } from "./compliance-flow";
-import { Transactions } from "./transactions";
-import { Wallet } from "./wallet";
+import { PayoutsPageClient } from "./page-client";
-export default function BankAccounts() {
+export default function Payouts() {
return (
<Suspense fallback={<LayoutLoader />}>
<h1 className="text-2xl font-semibold tracking-tight text-black">
Payouts
</h1>
- <div className="relative min-h-[calc(100vh-16px)]">
- <div className="grid gap-5 pb-10 pt-3">
- <BankAccount />
- <ComplianceFlow />
- <Wallet />
- <Transactions />
- </div>
- </div>
+ <PayoutsPageClient />
</Suspense>
);
}
diff --git a/packages/ui/src/icons/nucleo/badge-check.tsx b/packages/ui/src/icons/nucleo/badge-check.tsx
new file mode 100644
index 0000000000..9871515e5d
--- /dev/null
+++ b/packages/ui/src/icons/nucleo/badge-check.tsx
@@ -0,0 +1,32 @@
+import { SVGProps } from "react";
+
+export function BadgeCheck(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="M16.25,9c0-1.07-.675-1.975-1.619-2.332,.415-.92,.252-2.038-.504-2.794s-1.874-.92-2.794-.504c-.357-.945-1.263-1.619-2.332-1.619s-1.975,.675-2.332,1.619c-.92-.416-2.038-.252-2.794,.504s-.919,1.874-.504,2.794c-.945,.357-1.619,1.263-1.619,2.332s.675,1.975,1.619,2.332c-.415,.92-.252,2.038,.504,2.794s1.874,.92,2.794,.504c.357,.945,1.263,1.619,2.332,1.619s1.975-.675,2.332-1.619c.92,.415,2.038,.252,2.794-.504s.92-1.874,.504-2.794c.945-.357,1.619-1.263,1.619-2.332Z"
+ fill="none"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ <polyline
+ fill="none"
+ points="5.75 9.25 8 11.75 12.25 6.25"
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth="1.5"
+ />
+ </g>
+ </svg>
+ );
+}
diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.ts
index 018ef9b00e..16c867d2f6 100644
--- a/packages/ui/src/icons/nucleo/index.ts
+++ b/packages/ui/src/icons/nucleo/index.ts
@@ -5,6 +5,7 @@ export * from "./arrow-trend-up";
export * from "./arrow-turn-left";
export * from "./arrow-turn-right2";
export * from "./arrows-opposite-direction-y";
+export * from "./badge-check";
export * from "./blog";
export * from "./bolt";
export * from "./book2";