The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update expired & banned link pages
Tim Wilsona499fbf2b603
diff --git a/apps/web/app/[domain]/placeholder.tsx b/apps/web/app/[domain]/placeholder.tsxindex eebe724964..7e23c70ef9 100644--- a/apps/web/app/[domain]/placeholder.tsx+++ b/apps/web/app/[domain]/placeholder.tsx@@ -1,20 +1,14 @@"use client";+import { ButtonLink } from "@/ui/placeholders/button-link";import { CTA } from "@/ui/placeholders/cta";import { FeaturesSection } from "@/ui/placeholders/features-section";-import { buttonVariants, Grid, Logo } from "@dub/ui";+import { Hero } from "@/ui/placeholders/hero";+import { Logo } from "@dub/ui";import { cn, createHref } from "@dub/utils";-import Link from "next/link";import { useParams } from "next/navigation";+import { BubbleIcon } from "../../ui/placeholders/bubble-icon";import { BrowserGraphic } from "./browser-graphic";-import { BubbleIcon } from "./bubble-icon";--const HERO_GRADIENT = `radial-gradient(77% 116% at 37% 67%, #EEA5BA, rgba(238, 165, 186, 0) 50%),- radial-gradient(56% 84% at 34% 56%, #3A8BFD, rgba(58, 139, 253, 0) 50%),- radial-gradient(85% 127% at 100% 100%, #E4C795, rgba(228, 199, 149, 0) 50%),- radial-gradient(82% 122% at 3% 29%, #855AFC, rgba(133, 90, 252, 0) 50%),- radial-gradient(90% 136% at 52% 100%, #FD3A4E, rgba(253, 58, 78, 0) 50%),- radial-gradient(102% 143% at 92% 7%, #72FE7D, rgba(114, 254, 125, 0) 50%)`;const UTM_PARAMS = {utm_source: "Custom Domain",@@ -26,20 +20,11 @@ export default function PlaceholderContent() {return (<div>- <div className="relative mx-auto mt-4 w-full max-w-screen-lg overflow-hidden rounded-2xl bg-neutral-50 p-6 text-center sm:p-20 sm:px-0">- <Grid- cellSize={80}- patternOffset={[1, -58]}- className="inset-[unset] left-1/2 top-0 w-[1200px] -translate-x-1/2 text-neutral-300 [mask-image:linear-gradient(transparent,black_70%)]"- />- <div className="absolute -inset-x-10 bottom-0 h-[60%] opacity-40 blur-[100px] [transform:translate3d(0,0,0)]">- <div- className="size-full -scale-y-100 [mask-image:radial-gradient(closest-side,black_100%,transparent_100%)]"- style={{ backgroundImage: HERO_GRADIENT }}- />- </div>+ <Hero><div className="relative mx-auto flex w-full max-w-xl flex-col items-center">- <BubbleIcon icon={Logo} />+ <BubbleIcon>+ <Logo className="size-10" />+ </BubbleIcon><div className="mt-16 w-full"><BrowserGraphic domain={domain} /></div>@@ -64,34 +49,25 @@ export default function PlaceholderContent() {<divclassName={cn(- "relative mx-auto mt-8 flex max-w-fit space-x-4",+ "xs:flex-row relative mx-auto mt-8 flex max-w-fit flex-col items-center gap-4","animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",)}>- <Link- href="https://d.to/register"- className={cn(- buttonVariants({ variant: "primary" }),- "flex h-10 items-center rounded-lg border px-5 text-base",- )}- >+ <ButtonLink variant="primary" href="https://d.to/register">Try Dub today- </Link>- <Link+ </ButtonLink>+ <ButtonLink+ variant="secondary"href={createHref("/home", domain, {...UTM_PARAMS,utm_campaign: domain,utm_content: "Learn more",})}- className={cn(- buttonVariants({ variant: "secondary" }),- "flex h-10 items-center rounded-lg border px-5 text-base",- )}>Learn more- </Link>+ </ButtonLink></div>- </div>+ </Hero><div className="mt-20"><FeaturesSection domain={domain} utmParams={UTM_PARAMS} /></div>diff --git a/apps/web/app/banned/page.tsx b/apps/web/app/banned/page.tsxindex f0fa97f167..6e464fc4df 100644--- a/apps/web/app/banned/page.tsx+++ b/apps/web/app/banned/page.tsx@@ -1,6 +1,10 @@-import { Background, Footer, Nav, NavMobile } from "@dub/ui";-import { constructMetadata } from "@dub/utils";-import { ShieldBan } from "lucide-react";+import { BubbleIcon } from "@/ui/placeholders/bubble-icon";+import { ButtonLink } from "@/ui/placeholders/button-link";+import { CTA } from "@/ui/placeholders/cta";+import { FeaturesSection } from "@/ui/placeholders/features-section";+import { Hero } from "@/ui/placeholders/hero";+import { Footer, Nav, NavMobile, ShieldSlash } from "@dub/ui";+import { cn, constructMetadata, createHref } from "@dub/utils";export const runtime = "edge";@@ -10,28 +14,73 @@ export const metadata = constructMetadata({noIndex: true,});-export default async function BannedPage() {+const UTM_PARAMS = {+ utm_source: "Expired Link",+ utm_medium: "Expired Link Page",+};++export default async function BannedPage({+ params,+}: {+ params: { domain: string };+}) {return (<main className="flex min-h-screen flex-col justify-between">- <NavMobile staticDomain="dub.sh" />- <Nav staticDomain="dub.sh" />- <div className="z-10 mx-2 my-10 flex max-w-md flex-col items-center space-y-5 px-2.5 text-center sm:mx-auto sm:max-w-lg sm:px-0 lg:mb-16">- <div className="mx-auto flex h-20 w-20 items-center justify-center rounded-full border border-gray-300 bg-white/30">- <ShieldBan className="size-6 text-gray-500" />+ <NavMobile />+ <Nav maxWidthWrapperClassName="max-w-screen-lg lg:px-4 xl:px-0" />+ <div>+ <Hero>+ <div className="relative mx-auto flex w-full max-w-sm flex-col items-center">+ <BubbleIcon>+ <ShieldSlash className="size-12" />+ </BubbleIcon>+ <h1+ className={cn(+ "font-display mt-10 text-center text-4xl font-medium text-neutral-900 sm:text-5xl sm:leading-[1.15]",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:20px] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ Banned link+ </h1>+ <p+ className={cn(+ "mt-5 text-pretty text-base text-neutral-700 sm:text-xl",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:10px] [animation-delay:200ms] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ This link has been banned for violating our terms of service.+ </p>+ </div>++ <div+ className={cn(+ "xs:flex-row relative mx-auto mt-8 flex max-w-fit flex-col items-center gap-4",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ <ButtonLink variant="primary" href="https://d.to/register">+ Try Dub today+ </ButtonLink>+ <ButtonLink+ variant="secondary"+ href={createHref("/home", params.domain, {+ ...UTM_PARAMS,+ utm_campaign: params.domain,+ utm_content: "Learn more",+ })}+ >+ Learn more+ </ButtonLink>+ </div>+ </Hero>+ <div className="mt-20">+ <FeaturesSection domain={params.domain} utmParams={UTM_PARAMS} />+ </div>+ <div className="mt-32">+ <CTA domain={params.domain} utmParams={UTM_PARAMS} /></div>- <h1 className="font-display text-5xl font-bold">Banned Link</h1>- <p className="text-lg text-gray-600">- This link has been banned for violating our terms of service.- </p>- <a- href="https://dub.co/home"- className="rounded-full bg-gray-800 px-10 py-2 font-medium text-white transition-colors hover:bg-black"- >- Create Your Free Branded Link- </a></div>- <Footer staticDomain="dub.sh" />- <Background />+ <Footer className="max-w-screen-lg border-0 bg-transparent lg:px-4 xl:px-0" /></main>);}diff --git a/apps/web/app/expired/[domain]/page.tsx b/apps/web/app/expired/[domain]/page.tsxindex 5bf780d31e..4f9db0282d 100644--- a/apps/web/app/expired/[domain]/page.tsx+++ b/apps/web/app/expired/[domain]/page.tsx@@ -1,7 +1,11 @@import { getDomainViaEdge } from "@/lib/planetscale/get-domain-via-edge";-import { Background, Footer, Nav, NavMobile } from "@dub/ui";-import { CircleHalfDottedClock } from "@dub/ui/icons";-import { constructMetadata } from "@dub/utils";+import { BubbleIcon } from "@/ui/placeholders/bubble-icon";+import { ButtonLink } from "@/ui/placeholders/button-link";+import { CTA } from "@/ui/placeholders/cta";+import { FeaturesSection } from "@/ui/placeholders/features-section";+import { Hero } from "@/ui/placeholders/hero";+import { CircleHalfDottedClock, Footer, Nav, NavMobile } from "@dub/ui";+import { cn, constructMetadata, createHref } from "@dub/utils";import { redirect } from "next/navigation";export const runtime = "edge";@@ -13,39 +17,80 @@ export const metadata = constructMetadata({noIndex: true,});+const UTM_PARAMS = {+ utm_source: "Expired Link",+ utm_medium: "Expired Link Page",+};+export default async function ExpiredLinkPage({params,}: {params: { domain: string };}) {- const domain = await getDomainViaEdge(params.domain);+ const domainEdge = await getDomainViaEdge(params.domain);- if (domain?.expiredUrl) {- redirect(domain.expiredUrl);+ if (domainEdge?.expiredUrl) {+ redirect(domainEdge.expiredUrl);}return (<main className="flex min-h-screen flex-col justify-between"><NavMobile />- <Nav />- <div className="z-10 mx-2 my-10 flex max-w-md flex-col items-center space-y-5 px-2.5 text-center sm:mx-auto sm:max-w-lg sm:px-0 lg:mb-16">- <div className="mx-auto flex h-20 w-20 items-center justify-center rounded-full border border-gray-300 bg-white/80">- <CircleHalfDottedClock className="size-6 text-gray-500" />+ <Nav maxWidthWrapperClassName="max-w-screen-lg lg:px-4 xl:px-0" />+ <div>+ <Hero>+ <div className="relative mx-auto flex w-full max-w-md flex-col items-center">+ <BubbleIcon>+ <CircleHalfDottedClock className="size-12" />+ </BubbleIcon>+ <h1+ className={cn(+ "font-display mt-10 text-center text-4xl font-medium text-neutral-900 sm:text-5xl sm:leading-[1.15]",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:20px] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ Expired link+ </h1>+ <p+ className={cn(+ "mt-5 text-pretty text-base text-neutral-700 sm:text-xl",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:10px] [animation-delay:200ms] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ This link has expired. Please contact the owner of this link to+ get a new one.+ </p>+ </div>++ <div+ className={cn(+ "xs:flex-row relative mx-auto mt-8 flex max-w-fit flex-col items-center gap-4",+ "animate-slide-up-fade motion-reduce:animate-fade-in [--offset:5px] [animation-delay:300ms] [animation-duration:1s] [animation-fill-mode:both]",+ )}+ >+ <ButtonLink variant="primary" href="https://d.to/register">+ Try Dub today+ </ButtonLink>+ <ButtonLink+ variant="secondary"+ href={createHref("/home", params.domain, {+ ...UTM_PARAMS,+ utm_campaign: params.domain,+ utm_content: "Learn more",+ })}+ >+ Learn more+ </ButtonLink>+ </div>+ </Hero>+ <div className="mt-20">+ <FeaturesSection domain={params.domain} utmParams={UTM_PARAMS} />+ </div>+ <div className="mt-32">+ <CTA domain={params.domain} utmParams={UTM_PARAMS} /></div>- <h1 className="font-display text-5xl font-bold">Expired Link</h1>- <p className="text-lg text-gray-600">- This link has expired. Please contact the owner of this link to get a- new one.- </p>- <a- href="https://dub.co/home"- className="rounded-full bg-gray-800 px-10 py-2 font-medium text-white transition-colors hover:bg-black"- >- Create Your Free Branded Link- </a></div>- <Footer />- <Background />+ <Footer className="max-w-screen-lg border-0 bg-transparent lg:px-4 xl:px-0" /></main>);}diff --git a/apps/web/app/[domain]/bubble-icon.tsx b/apps/web/ui/placeholders/bubble-icon.tsxsimilarity index 87%rename from apps/web/app/[domain]/bubble-icon.tsxrename to apps/web/ui/placeholders/bubble-icon.tsxindex df5562a6f5..a946e24ee7 100644--- a/apps/web/app/[domain]/bubble-icon.tsx+++ b/apps/web/ui/placeholders/bubble-icon.tsx@@ -1,9 +1,8 @@"use client";-import { Icon } from "@dub/ui";-import { useEffect, useRef } from "react";+import { PropsWithChildren, useEffect, useRef } from "react";-export function BubbleIcon({ icon: Icon }: { icon: Icon }) {+export function BubbleIcon({ children }: PropsWithChildren) {const ref = useRef<HTMLDivElement>(null);// Pass relative mouse position to the element@@ -46,8 +45,8 @@ export function BubbleIcon({ icon: Icon }: { icon: Icon }) {transform: `rotateY(clamp(-20deg, calc(var(--mx, 0.5) * 4deg), 20deg)) rotateX(clamp(-20deg, calc(var(--my, 0.5) * -4deg), 20deg))`,}}>- <div className="rounded-full bg-gradient-to-b from-white to-neutral-100 p-8">- <Icon className="size-10" />+ <div className="flex size-[104px] items-center justify-center rounded-full bg-gradient-to-b from-white to-neutral-100">+ {children}</div><div className="absolute inset-0 rounded-full bg-gradient-to-t from-[#fff8]" />diff --git a/apps/web/ui/placeholders/button-link.tsx b/apps/web/ui/placeholders/button-link.tsxnew file mode 100644index 0000000000..e19d2a78db--- /dev/null+++ b/apps/web/ui/placeholders/button-link.tsx@@ -0,0 +1,23 @@+"use client";++import { ButtonProps, buttonVariants } from "@dub/ui";+import { cn } from "@dub/utils";+import Link from "next/link";+import { ComponentProps } from "react";++export function ButtonLink({+ variant,+ className,+ ...rest+}: Pick<ButtonProps, "variant"> & ComponentProps<typeof Link>) {+ return (+ <Link+ {...rest}+ className={cn(+ buttonVariants({ variant }),+ "flex h-10 w-fit items-center whitespace-nowrap rounded-lg border px-5 text-base",+ className,+ )}+ />+ );+}diff --git a/apps/web/ui/placeholders/cta.tsx b/apps/web/ui/placeholders/cta.tsxindex 3513b90e32..d5a0389bce 100644--- a/apps/web/ui/placeholders/cta.tsx+++ b/apps/web/ui/placeholders/cta.tsx@@ -1,8 +1,8 @@-import { buttonVariants, Grid } from "@dub/ui";+import { Grid } from "@dub/ui";import { cn, createHref, UTMTags } from "@dub/utils";import { Star, StarHalf } from "lucide-react";-import Link from "next/link";import { ReactNode } from "react";+import { ButtonLink } from "./button-link";import Logos from "./logos";const RATINGS = [@@ -100,29 +100,20 @@ export function CTA({</div><div className="relative mx-auto mt-10 flex max-w-fit space-x-4">- <Link- href="https://d.to/register"- className={cn(- buttonVariants({ variant: "primary" }),- "flex h-10 items-center rounded-lg border px-5 text-base",- )}- >+ <ButtonLink variant="primary" href="https://d.to/register">Start for free- </Link>- <Link+ </ButtonLink>+ <ButtonLink+ variant="secondary"href={createHref("/enterprise", domain, {utm_source: "Custom Domain",utm_medium: "Welcome Page",utm_campaign: domain,utm_content: "Get a demo",})}- className={cn(- buttonVariants({ variant: "secondary" }),- "flex h-10 items-center rounded-lg border px-5 text-base",- )}>Get a demo- </Link>+ </ButtonLink></div><div className="relative">diff --git a/apps/web/ui/placeholders/hero.tsx b/apps/web/ui/placeholders/hero.tsxnew file mode 100644index 0000000000..fea63d278c--- /dev/null+++ b/apps/web/ui/placeholders/hero.tsx@@ -0,0 +1,28 @@+import { Grid } from "@dub/ui";+import { PropsWithChildren } from "react";++const HERO_GRADIENT = `radial-gradient(77% 116% at 37% 67%, #EEA5BA, rgba(238, 165, 186, 0) 50%),+ radial-gradient(56% 84% at 34% 56%, #3A8BFD, rgba(58, 139, 253, 0) 50%),+ radial-gradient(85% 127% at 100% 100%, #E4C795, rgba(228, 199, 149, 0) 50%),+ radial-gradient(82% 122% at 3% 29%, #855AFC, rgba(133, 90, 252, 0) 50%),+ radial-gradient(90% 136% at 52% 100%, #FD3A4E, rgba(253, 58, 78, 0) 50%),+ radial-gradient(102% 143% at 92% 7%, #72FE7D, rgba(114, 254, 125, 0) 50%)`;++export function Hero({ children }: PropsWithChildren) {+ return (+ <div className="relative mx-auto mt-4 w-full max-w-screen-lg overflow-hidden rounded-2xl bg-neutral-50 p-6 text-center sm:p-20 sm:px-0">+ <Grid+ cellSize={80}+ patternOffset={[1, -58]}+ className="inset-[unset] left-1/2 top-0 w-[1200px] -translate-x-1/2 text-neutral-300 [mask-image:linear-gradient(transparent,black_70%)]"+ />+ <div className="absolute -inset-x-10 bottom-0 h-[60%] opacity-40 blur-[100px] [transform:translate3d(0,0,0)]">+ <div+ className="size-full -scale-y-100 [mask-image:radial-gradient(closest-side,black_100%,transparent_100%)]"+ style={{ backgroundImage: HERO_GRADIENT }}+ />+ </div>+ {children}+ </div>+ );+}diff --git a/packages/ui/src/icons/nucleo/index.ts b/packages/ui/src/icons/nucleo/index.tsindex b6c29e6941..67a08aa061 100644--- a/packages/ui/src/icons/nucleo/index.ts+++ b/packages/ui/src/icons/nucleo/index.ts@@ -142,6 +142,7 @@ export * from "./scribble";export * from "./shield-alert";export * from "./shield-check";export * from "./shield-keyhole";+export * from "./shield-slash";export * from "./shuffle";export * from "./sliders";export * from "./sparkle3";diff --git a/packages/ui/src/icons/nucleo/shield-slash.tsx b/packages/ui/src/icons/nucleo/shield-slash.tsxnew file mode 100644index 0000000000..96cbec5733--- /dev/null+++ b/packages/ui/src/icons/nucleo/shield-slash.tsx@@ -0,0 +1,43 @@+import { SVGProps } from "react";++export function ShieldSlash(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="M4.216,13.784c-.848-.755-1.466-1.683-1.466-2.784V4.48c0-.435,.281-.82,.695-.952l5.25-1.68c.198-.063,.411-.063,.61,0l5.188,1.66"+ fill="none"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="1.5"+ />+ <path+ d="M15.25,6.285v4.715c0,3.03-4.684,4.748-5.942,5.155-.203,.066-.413,.066-.616,0-.458-.148-1.371-.47-2.346-.966"+ fill="none"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="1.5"+ />+ <line+ fill="none"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="1.5"+ x1="2"+ x2="16"+ y1="16"+ y2="2"+ />+ </g>+ </svg>+ );+}