The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add PartnersUpgradeCTA
Steven Teya464964329bb
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsxindex 29da423c53..449734f53b 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/auth.tsx@@ -4,11 +4,9 @@ import { getPlanCapabilities } from "@/lib/plan-capabilities";import useWorkspace from "@/lib/swr/use-workspace";import LayoutLoader from "@/ui/layout/layout-loader";import { PageContent } from "@/ui/layout/page-content";-import { Badge, buttonVariants } from "@dub/ui";-import { capitalize, cn, nFormatter } from "@dub/utils";-import Link from "next/link";import { redirect, useRouter } from "next/navigation";import { ReactNode, useEffect, useState } from "react";+import { PartnersUpgradeCTA } from "./partners-ugrade-cta";export default function ProgramAuth({ children }: { children: ReactNode }) {const router = useRouter();@@ -39,143 +37,10 @@ export default function ProgramAuth({ children }: { children: ReactNode }) {if (!getPlanCapabilities(plan).canManageProgram) {return (<PageContent>- <UpgradeCTA />+ <PartnersUpgradeCTA /></PageContent>);}return children;}--export const EXAMPLE_PARTNERS = [- {- name: "Lauren Anderson",- country: "US",- revenue: 1_800,- payouts: 550,- index: 0,- },- {- name: "Elias Weber",- country: "DE",- revenue: 783,- payouts: 235,- index: 4,- },- {- name: "Hiroshi Tanaka",- country: "JP",- revenue: 19_200,- payouts: 5_700,- index: 3,- },- {- name: "Mia Taylor",- country: "US",- revenue: 22_600,- payouts: 6_800,- index: 1,- },-];--const UpgradeCTA = () => {- const { slug, plan } = useWorkspace();-- const { canManageProgram } = getPlanCapabilities(plan);-- return (- <div className="flex min-h-[calc(100vh-60px)] flex-col items-center justify-center gap-6 overflow-hidden px-4 py-10">- <div className="grid w-max grid-cols-2 overflow-hidden px-4 [mask-image:linear-gradient(black,transparent)]">- {EXAMPLE_PARTNERS.map((partner, idx) => (- <ExamplePartnerCell key={idx} partner={partner} />- ))}- </div>- <Badge variant="blueGradient">Coming soon</Badge>- <div className="max-w-sm text-pretty text-center">- <span className="text-base font-medium text-neutral-900">- Dub Partners- </span>- <p className="mt-2 text-pretty text-sm text-neutral-500">- Kickstart viral product-led growth with powerful, branded referral and- affiliate programs.{" "}- <Link- href="https://dub.co/partners"- target="_blank"- className="text-content-default hover:text-content-emphasis font-medium transition-colors"- >- Learn more ↗- </Link>- </p>- </div>- <div className="flex items-center gap-2">- <Link- href={- canManageProgram- ? "https://dub.co/help/article/dub-partners"- : `/${slug}/upgrade`- }- className={cn(- buttonVariants({ variant: "primary" }),- "flex h-10 items-center justify-center whitespace-nowrap rounded-lg border px-3 text-sm",- )}- >- {canManageProgram ? "Join the waitlist" : "Upgrade plan"}- </Link>- </div>- </div>- );-};--function ExamplePartnerCell({- partner,-}: {- partner: (typeof EXAMPLE_PARTNERS)[number];-}) {- return (- <div className="h-[104px] w-[284px] p-1">- <div className="flex size-full select-none overflow-hidden rounded-[10px] border border-neutral-200 bg-transparent bg-white p-2">- {partner && (- <>- <div- key={partner.index}- className="aspect-square h-full rounded-lg border border-neutral-300 bg-neutral-300"- style={{- backgroundImage:- "url(https://assets.dub.co/partners/partner-images.jpg)",- backgroundSize: "1400%", // 14 images- backgroundPositionX: (14 - (partner.index % 14)) * 100 + "%",- }}- />- <div className="flex h-full flex-col justify-between px-4 py-3">- <div className="flex items-center gap-1.5">- <img- alt={`${partner.country} flag`}- src={`https://hatscripts.github.io/circle-flags/flags/${partner.country.toLowerCase()}.svg`}- className="size-3.5 rounded-full"- />- <span className="whitespace-nowrap text-sm font-medium text-neutral-800">- {partner.name}- </span>- </div>- <div className="flex divide-x divide-neutral-200">- {["revenue", "payouts"].map((key, idx) => (- <div- key={key}- className={cn("flex flex-col", idx === 0 ? "pr-6" : "pl-6")}- >- <span className="text-xs font-medium text-neutral-400">- {capitalize(key)}- </span>- <span className="text-sm font-medium text-neutral-600">- ${nFormatter(partner[key])}- </span>- </div>- ))}- </div>- </div>- </>- )}- </div>- </div>- );-}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsxnew file mode 100644index 0000000000..eb0d33ab30--- /dev/null+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners-ugrade-cta.tsx@@ -0,0 +1,150 @@+"use client";++import { getPlanCapabilities } from "@/lib/plan-capabilities";+import useWorkspace from "@/lib/swr/use-workspace";+import { Badge, buttonVariants } from "@dub/ui";+import { capitalize, cn, nFormatter } from "@dub/utils";+import Link from "next/link";++export function PartnersUpgradeCTA({+ title,+ description,+}: {+ title?: string;+ description?: string;+}) {+ const { slug, plan } = useWorkspace();++ const { canManageProgram } = getPlanCapabilities(plan);++ return (+ <div className="flex min-h-[calc(100vh-60px)] flex-col items-center justify-center gap-6 overflow-hidden px-4 py-10">+ <div className="grid w-max grid-cols-2 overflow-hidden px-4 [mask-image:linear-gradient(black,transparent)]">+ {EXAMPLE_PARTNERS.map((partner, idx) => (+ <ExamplePartnerCell key={idx} partner={partner} />+ ))}+ </div>+ <Badge variant="blueGradient">Coming soon</Badge>+ <div className="max-w-sm text-pretty text-center">+ <span className="text-base font-medium text-neutral-900">+ {title || "Dub Partners"}+ </span>+ <p className="mt-2 text-pretty text-sm text-neutral-500">+ {description || (+ <>+ Kickstart viral product-led growth with powerful, branded referral+ and affiliate programs.{" "}+ <Link+ href="https://dub.co/partners"+ target="_blank"+ className="text-content-default hover:text-content-emphasis font-medium transition-colors"+ >+ Learn more ↗+ </Link>+ </>+ )}+ </p>+ </div>+ <div className="flex items-center gap-2">+ <Link+ href={+ canManageProgram+ ? "https://dub.co/help/article/dub-partners"+ : `/${slug}/upgrade`+ }+ className={cn(+ buttonVariants({ variant: "primary" }),+ "flex h-10 items-center justify-center whitespace-nowrap rounded-lg border px-3 text-sm",+ )}+ >+ {canManageProgram ? "Join the waitlist" : "Upgrade plan"}+ </Link>+ </div>+ </div>+ );+}++const EXAMPLE_PARTNERS = [+ {+ name: "Lauren Anderson",+ country: "US",+ revenue: 1_800,+ payouts: 550,+ index: 0,+ },+ {+ name: "Elias Weber",+ country: "DE",+ revenue: 783,+ payouts: 235,+ index: 4,+ },+ {+ name: "Hiroshi Tanaka",+ country: "JP",+ revenue: 19_200,+ payouts: 5_700,+ index: 3,+ },+ {+ name: "Mia Taylor",+ country: "US",+ revenue: 22_600,+ payouts: 6_800,+ index: 1,+ },+];++function ExamplePartnerCell({+ partner,+}: {+ partner: (typeof EXAMPLE_PARTNERS)[number];+}) {+ return (+ <div className="h-[104px] w-[284px] p-1">+ <div className="flex size-full select-none overflow-hidden rounded-[10px] border border-neutral-200 bg-transparent bg-white p-2">+ {partner && (+ <>+ <div+ key={partner.index}+ className="aspect-square h-full rounded-lg border border-neutral-300 bg-neutral-300"+ style={{+ backgroundImage:+ "url(https://assets.dub.co/partners/partner-images.jpg)",+ backgroundSize: "1400%", // 14 images+ backgroundPositionX: (14 - (partner.index % 14)) * 100 + "%",+ }}+ />+ <div className="flex h-full flex-col justify-between px-4 py-3">+ <div className="flex items-center gap-1.5">+ <img+ alt={`${partner.country} flag`}+ src={`https://hatscripts.github.io/circle-flags/flags/${partner.country.toLowerCase()}.svg`}+ className="size-3.5 rounded-full"+ />+ <span className="whitespace-nowrap text-sm font-medium text-neutral-800">+ {partner.name}+ </span>+ </div>+ <div className="flex divide-x divide-neutral-200">+ {["revenue", "payouts"].map((key, idx) => (+ <div+ key={key}+ className={cn("flex flex-col", idx === 0 ? "pr-6" : "pl-6")}+ >+ <span className="text-xs font-medium text-neutral-400">+ {capitalize(key)}+ </span>+ <span className="text-sm font-medium text-neutral-600">+ ${nFormatter(partner[key])}+ </span>+ </div>+ ))}+ </div>+ </div>+ </>+ )}+ </div>+ </div>+ );+}diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/directory/page.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/directory/page.tsxnew file mode 100644index 0000000000..969185427c--- /dev/null+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/directory/page.tsx@@ -0,0 +1,13 @@+import { PageContent } from "@/ui/layout/page-content";+import { PartnersUpgradeCTA } from "../../partners-ugrade-cta";++export default function ProgramPartnersDirectory() {+ return (+ <PageContent>+ <PartnersUpgradeCTA+ title="Partner Directory"+ description="Discover top performing partners that have a proven track record of success helping companies grow."+ />+ </PageContent>+ );+}diff --git a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsxindex 2c47c9f01a..0e7407e0d9 100644--- a/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx+++ b/apps/web/ui/layout/sidebar/app-sidebar-nav.tsx@@ -188,7 +188,7 @@ const NAV_AREAS: SidebarNavAreas<SidebarNavData> = {{name: "Partner Directory",icon: UserPlus,- href: `/${slug}/program/partners`,+ href: `/${slug}/program/partners/directory`,},],},