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

Tim Wilson401b7967f9cc
diff --git a/apps/web/ui/customers/customer-table/customer-table.tsx b/apps/web/ui/customers/customer-table/customer-table.tsx
index 77237edc42..51e414badd 100644
--- a/apps/web/ui/customers/customer-table/customer-table.tsx
+++ b/apps/web/ui/customers/customer-table/customer-table.tsx
@@ -11,6 +11,7 @@ import { SearchBoxPersisted } from "@/ui/shared/search-box";
import {
AnimatedSizeContainer,
Button,
+ buttonVariants,
CopyText,
Filter,
LinkLogo,
@@ -24,6 +25,7 @@ import {
} from "@dub/ui";
import { Copy, Dots, User } from "@dub/ui/icons";
import {
+ cn,
COUNTRIES,
currencyFormatter,
fetcher,
@@ -33,6 +35,7 @@ import {
} from "@dub/utils";
import { Row } from "@tanstack/react-table";
import { Command } from "cmdk";
+import Image from "next/image";
import Link from "next/link";
import { useParams, useRouter } from "next/navigation";
import { useMemo, useState } from "react";
@@ -88,6 +91,8 @@ export function CustomerTable() {
const { columnVisibility, setColumnVisibility } = useColumnVisibility();
const { pagination, setPagination } = usePagination();
+ if (!canManageCustomers) columnVisibility.link = false;
+
const columns = useMemo(
() =>
[
@@ -292,10 +297,42 @@ export function CustomerTable() {
>
{!canManageCustomers && (
<>
- <div className="absolute inset-0 flex touch-pan-y items-center justify-center bg-gradient-to-t from-[#fff_70%] to-[#fff6]">
- upgrade!
+ <div className="absolute inset-0 flex touch-pan-y flex-col items-center justify-center bg-gradient-to-t from-[#fff_75%] to-[#fff6] px-4 text-center">
+ <div className="h-40 w-full max-w-[480px] overflow-hidden [mask-image:linear-gradient(black,transparent)]">
+ <div className="relative h-96 w-full overflow-hidden rounded-lg border border-neutral-200">
+ <Image
+ src="https://assets.dub.co/misc/customer-screenshot.jpg"
+ fill
+ className="object-contain object-top"
+ alt="Customer overview screenshot"
+ draggable={false}
+ />
+ </div>
+ </div>
+ <div className="relative -mt-4 flex flex-col items-center justify-center">
+ <span className="text-lg font-semibold text-neutral-700">
+ Customers
+ </span>
+ <p className="mt-3 max-w-sm text-pretty text-sm text-neutral-500">
+ Upgrade to our Business Plan to see more details about your
+ customers, their activity, and how they&rsquo;ve impacted
+ your business.
+ {/* TODO: Add "Learn more" link once we have a help article */}
+ </p>
+ <div className="mt-8">
+ <Link
+ href={`/${workspaceSlug}/upgrade`}
+ className={cn(
+ buttonVariants({ variant: "primary" }),
+ "flex h-10 items-center justify-center gap-2 rounded-md border px-4 text-sm",
+ )}
+ >
+ Upgrade to Business
+ </Link>
+ </div>
+ </div>
</div>
- <div className="h-[400px]" />
+ <div className="h-[420px]" />
</>
)}
</Table>
diff --git a/apps/web/ui/customers/customer-table/example-data.ts b/apps/web/ui/customers/customer-table/example-data.ts
index 13c0133cbd..b282205e29 100644
--- a/apps/web/ui/customers/customer-table/example-data.ts
+++ b/apps/web/ui/customers/customer-table/example-data.ts
@@ -6,7 +6,7 @@ export const EXAMPLE_CUSTOMER_DATA = [
externalId: "djk29fjj3I1",
name: "Liam White",
- avatar: "https://avatar.vercel.sh/l.png?text=L",
+ avatar: "https://api.dub.co/og/avatar?seed=l",
country: "US",
sales: 1,
saleAmount: 20_00,
@@ -19,8 +19,8 @@ export const EXAMPLE_CUSTOMER_DATA = [
externalId: "c34kd94jcz2",
name: "Emma Green",
- avatar: "https://avatar.vercel.sh/e.png?text=E",
- country: "US",
+ avatar: "https://api.dub.co/og/avatar?seed=e",
+ country: "CA",
sales: 30,
saleAmount: 1200_00,
createdAt: new Date(new Date().getTime() - 20 * millisecondsPerDay),
@@ -32,7 +32,7 @@ export const EXAMPLE_CUSTOMER_DATA = [
externalId: "nm58fnz9071",
name: "Daniel Brown",
- avatar: "https://avatar.vercel.sh/d.png?text=D",
+ avatar: "https://api.dub.co/og/avatar?seed=d",
country: "US",
sales: 3,
saleAmount: 90_00,