The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Add Dub Partners banner
Tim Wilsonb9689094253f
diff --git a/apps/web/app/app.dub.co/(auth)/login/page.tsx b/apps/web/app/app.dub.co/(auth)/login/page.tsxindex ed413ebfa0..76a2335262 100644--- a/apps/web/app/app.dub.co/(auth)/login/page.tsx+++ b/apps/web/app/app.dub.co/(auth)/login/page.tsx@@ -1,3 +1,4 @@+import { DubPartnersBanner } from "@/ui/auth/dub-partners-banner";import LoginForm from "@/ui/auth/login/login-form";import { AuthLayout } from "@/ui/layout/auth-layout";import { APP_DOMAIN, constructMetadata } from "@dub/utils";@@ -18,16 +19,20 @@ export default function LoginPage() {<div className="mt-8"><LoginForm /></div>+ <p className="mt-6 text-center text-sm font-medium text-neutral-500">+ Don't have an account? + <Link+ href="register"+ className="font-semibold text-neutral-700 transition-colors hover:text-neutral-900"+ >+ Sign up+ </Link>+ </p>++ <div className="mt-12 w-full">+ <DubPartnersBanner variant="login" />+ </div></div>- <p className="mt-6 text-center text-sm font-medium text-neutral-500">- Don't have an account? - <Link- href="register"- className="font-semibold text-neutral-700 transition-colors hover:text-neutral-900"- >- Sign up- </Link>- </p></AuthLayout>);}diff --git a/apps/web/app/app.dub.co/(auth)/register/page-client.tsx b/apps/web/app/app.dub.co/(auth)/register/page-client.tsxindex 5c41859dae..7fde599e2d 100644--- a/apps/web/app/app.dub.co/(auth)/register/page-client.tsx+++ b/apps/web/app/app.dub.co/(auth)/register/page-client.tsx@@ -1,5 +1,6 @@"use client";+import { DubPartnersBanner } from "@/ui/auth/dub-partners-banner";import {RegisterProvider,useRegisterContext,@@ -27,16 +28,20 @@ function SignUp() {<div className="mt-8"><SignUpForm /></div>+ <p className="mt-6 text-center text-sm font-medium text-neutral-500">+ Already have an account? + <Link+ href="/login"+ className="font-semibold text-neutral-700 transition-colors hover:text-neutral-900"+ >+ Log in+ </Link>+ </p>++ <div className="mt-12 w-full">+ <DubPartnersBanner variant="register" />+ </div></div>- <p className="mt-6 text-center text-sm font-medium text-neutral-500">- Already have an account? - <Link- href="/login"- className="font-semibold text-neutral-700 transition-colors hover:text-neutral-900"- >- Log in- </Link>- </p></>);}diff --git a/apps/web/ui/auth/dub-partners-banner.tsx b/apps/web/ui/auth/dub-partners-banner.tsxnew file mode 100644index 0000000000..bc7871ce4e--- /dev/null+++ b/apps/web/ui/auth/dub-partners-banner.tsx@@ -0,0 +1,41 @@+import { DotsPattern } from "@dub/ui";+import Link from "next/link";++const variants = {+ login: {+ text: "Looking for your Dub Partner account?",+ cta: "Log in at partners.dub.co",+ href: "https://partners.dub.co/login",+ },+ register: {+ text: "Looking for a Dub Partner account?",+ cta: "Sign up at partners.dub.co",+ href: "https://partners.dub.co/register",+ },+};++export function DubPartnersBanner({+ variant,+}: {+ variant: "login" | "register";+}) {+ const { text, href, cta } = variants[variant];++ return (+ <Link+ href={href}+ className="relative block overflow-hidden rounded-lg border border-neutral-200 bg-neutral-50 px-2 py-4 transition-colors hover:bg-neutral-100"+ >+ <div+ className="absolute inset-y-0 left-1/2 w-[640px] -translate-x-1/2"+ role="presentation"+ >+ <DotsPattern patternOffset={[1, 5]} className="text-neutral-200" />+ </div>+ <div className="relative text-center text-sm text-neutral-600">+ <p>{text}</p>+ <span className="block font-semibold text-neutral-800">{cta}</span>+ </div>+ </Link>+ );+}diff --git a/packages/ui/src/dots-pattern.tsx b/packages/ui/src/dots-pattern.tsxnew file mode 100644index 0000000000..f6b272952f--- /dev/null+++ b/packages/ui/src/dots-pattern.tsx@@ -0,0 +1,47 @@+import { cn } from "@dub/utils";+import { useId } from "react";++export function DotsPattern({+ dotSize = 2,+ gapSize = 10,+ patternOffset = [0, 0],+ className,+}: {+ dotSize?: number;+ gapSize?: number;+ patternOffset?: [number, number];+ className?: string;+}) {+ const id = useId();++ return (+ <svg+ className={cn(+ "pointer-events-none absolute inset-0 text-black/10",+ className,+ )}+ width="100%"+ height="100%"+ >+ <defs>+ <pattern+ id={`dots-${id}`}+ x={patternOffset[0] - 1}+ y={patternOffset[1] - 1}+ width={dotSize + gapSize}+ height={dotSize + gapSize}+ patternUnits="userSpaceOnUse"+ >+ <rect+ x={1}+ y={1}+ width={dotSize}+ height={dotSize}+ fill="currentColor"+ />+ </pattern>+ </defs>+ <rect fill={`url(#dots-${id})`} width="100%" height="100%" />+ </svg>+ );+}diff --git a/packages/ui/src/index.tsx b/packages/ui/src/index.tsxindex 5902aee963..20ff890127 100644--- a/packages/ui/src/index.tsx+++ b/packages/ui/src/index.tsx@@ -12,6 +12,7 @@ export * from "./carousel";export * from "./checkbox";export * from "./combobox";export * from "./date-picker";+export * from "./dots-pattern";export * from "./dub-status-badge";export * from "./empty-state";export * from "./file-upload";