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.

update empty states

Steven Teyf25a414aced7
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
index c1519d8005..9337844b5f 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/page-client.tsx
@@ -358,7 +358,7 @@ function ImportOption({
content={
<TooltipContent
title="Your workspace has exceeded its monthly links limit. We're still collecting data on your existing links, but you need to upgrade to add more links."
- cta={`Upgrade to ${nextPlan.name}`}
+ cta={nextPlan ? `Upgrade to ${nextPlan.name}` : "Contact support"}
href={`/${slug}/upgrade`}
/>
}
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/people/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/people/page-client.tsx
index 5c662459d3..035ba0eb94 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/people/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/people/page-client.tsx
@@ -8,6 +8,7 @@ import { useEditRoleModal } from "@/ui/modals/edit-role-modal";
import { useInviteCodeModal } from "@/ui/modals/invite-code-modal";
import { useInviteTeammateModal } from "@/ui/modals/invite-teammate-modal";
import { useRemoveTeammateModal } from "@/ui/modals/remove-teammate-modal";
+import { AnimatedEmptyState } from "@/ui/shared/animated-empty-state";
import {
CheckCircleFill,
Link as LinkIcon,
@@ -21,6 +22,7 @@ import {
IconMenu,
Popover,
useCopyToClipboard,
+ UserCheck,
} from "@dub/ui";
import { capitalize, cn, timeAgo } from "@dub/utils";
import { UserMinus } from "lucide-react";
@@ -108,16 +110,17 @@ export default function WorkspacePeopleClient() {
<UserCard key={user.id} user={user} currentTab={currentTab} />
))
) : (
- <div className="flex flex-col items-center justify-center py-10">
- <img
- src="https://assets.dub.co/misc/video-park.svg"
- alt="No invitations sent"
- width={300}
- height={300}
- className="pointer-events-none -my-8"
- />
- <p className="text-sm text-neutral-500">No invitations sent</p>
- </div>
+ <AnimatedEmptyState
+ title="No invitations sent"
+ description="No teammates have been added to this workspace yet."
+ cardContent={() => (
+ <>
+ <UserCheck className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ </>
+ )}
+ className="border-none"
+ />
)
) : (
Array.from({ length: 5 }).map((_, i) => <UserPlaceholder key={i} />)
diff --git a/apps/web/ui/shared/upgrade-required-toast.tsx b/apps/web/ui/shared/upgrade-required-toast.tsx
index 7471f37af2..ae5dc0f838 100644
--- a/apps/web/ui/shared/upgrade-required-toast.tsx
+++ b/apps/web/ui/shared/upgrade-required-toast.tsx
@@ -25,7 +25,7 @@ export const UpgradeRequiredToast = ({
target="_blank"
className="w-full rounded-md border border-black bg-black px-3 py-1.5 text-center text-sm text-white transition-all hover:bg-neutral-800 hover:ring-4 hover:ring-neutral-200"
>
- Upgrade to {nextPlan.name}
+ {nextPlan ? `Upgrade to ${nextPlan.name}` : "Contact support"}
</Link>
</div>
);
diff --git a/apps/web/ui/workspaces/workspace-exceeded-clicks.tsx b/apps/web/ui/workspaces/workspace-exceeded-clicks.tsx
index 539f4a5867..a3c47eaf0a 100644
--- a/apps/web/ui/workspaces/workspace-exceeded-clicks.tsx
+++ b/apps/web/ui/workspaces/workspace-exceeded-clicks.tsx
@@ -1,10 +1,9 @@
"use client";
import useWorkspace from "@/lib/swr/use-workspace";
-import { buttonVariants, MaxWidthWrapper } from "@dub/ui";
-import { cn } from "@dub/utils";
-import { Lock } from "lucide-react";
-import Link from "next/link";
+import { MaxWidthWrapper } from "@dub/ui";
+import { CursorRays } from "../layout/sidebar/icons/cursor-rays";
+import { AnimatedEmptyState } from "../shared/animated-empty-state";
export default function WorkspaceExceededClicks() {
const { slug, nextPlan } = useWorkspace();
@@ -12,33 +11,23 @@ export default function WorkspaceExceededClicks() {
return (
<MaxWidthWrapper>
<div className="my-10 flex flex-col items-center justify-center rounded-md border border-neutral-200 bg-white py-12">
- <div className="rounded-full bg-neutral-100 p-3">
- <Lock className="h-6 w-6 text-neutral-600" />
- </div>
- <h1 className="my-3 text-xl font-semibold text-neutral-700">
- Stats Locked
- </h1>
- <p className="z-10 max-w-sm text-center text-sm text-neutral-600">
- Your workspace has exceeded your monthly clicks limits. We're still
- collecting data on your links, but you need to upgrade to view them.
- </p>
- <img
- src="https://assets.dub.co/misc/video-park.svg"
- alt="No links yet"
- width={400}
- height={400}
- className="-my-8"
- />
-
- <Link
- href={`/${slug}/upgrade`}
- className={cn(
- buttonVariants(),
- "flex h-9 items-center justify-center rounded-md border px-4 text-sm",
+ <AnimatedEmptyState
+ title="Stats Locked"
+ description="Your workspace has exceeded your monthly clicks limits. We're still collecting data on your links, but you need to upgrade to view them."
+ cardContent={() => (
+ <>
+ <CursorRays className="size-4 text-neutral-700" />
+ <div className="h-2.5 w-24 min-w-0 rounded-sm bg-neutral-200" />
+ </>
)}
- >
- Upgrade to {nextPlan.name}
- </Link>
+ className="border-none"
+ learnMoreText={
+ nextPlan ? `Upgrade to ${nextPlan.name}` : "Contact support"
+ }
+ learnMoreHref={
+ nextPlan ? `/${slug}/upgrade?exit=close` : "https://dub.co/contact"
+ }
+ />
</div>
</MaxWidthWrapper>
);