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.

.dub.link changes (#3871)

Marcus Farrella5fa0252c16d
diff --git a/apps/web/app/api/domains/route.ts b/apps/web/app/api/domains/route.ts
index af4d869c9c..09b40b913c 100644
--- a/apps/web/app/api/domains/route.ts
+++ b/apps/web/app/api/domains/route.ts
@@ -207,6 +207,9 @@ export const POST = withWorkspace(
slug: slug,
projectId: workspace.id,
primary: totalDomains === 0,
+ ...(slug.endsWith(".dub.link") && {
+ verified: true,
+ }),
...(placeholder && { placeholder }),
expiredUrl,
notFoundUrl,
diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/default-domain-selector.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/default-domain-selector.tsx
index a1f000c8f4..d6f06622b8 100644
--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/default-domain-selector.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/default-domain-selector.tsx
@@ -1,8 +1,17 @@
"use client";
import { OnboardingStep } from "@/lib/onboarding/types";
-import { BoltFill, Button, Crown, Icon } from "@dub/ui";
-import { capitalize } from "@dub/utils";
+import {
+ BoltFill,
+ Button,
+ CircleCheckFill,
+ Crown,
+ CursorRays,
+ Flask,
+ Globe,
+ type Icon,
+} from "@dub/ui";
+import { capitalize, cn } from "@dub/utils";
import { usePlausible } from "next-plausible";
import Image from "next/image";
import { useSearchParams } from "next/navigation";
@@ -19,54 +28,88 @@ export function DefaultDomainSelector() {
return (
<>
<div className="animate-fade-in mx-auto grid w-full gap-4 sm:max-w-[600px] sm:grid-cols-2">
+ <DomainOption
+ step="domain/custom"
+ icon="https://assets.dub.co/icons/domain-sign.webp"
+ bannerIcon={CircleCheckFill}
+ bannerText="Recommended setup"
+ bannerVariant="recommended"
+ title="Connect a custom domain"
+ description={
+ product === "links"
+ ? "Already have a domain? Connect it to your Dub workspace."
+ : undefined
+ }
+ features={
+ product === "partners"
+ ? [
+ {
+ icon: CursorRays,
+ text: (
+ <>
+ <a
+ href="https://dub.co/blog/custom-domains"
+ target="_blank"
+ className="underline decoration-dotted underline-offset-2 transition-colors hover:text-neutral-700"
+ >
+ Higher click-through rates
+ </a>
+ </>
+ ),
+ },
+ {
+ icon: Globe,
+ text: (
+ <>
+ Requires a{" "}
+ <a
+ href="https://dub.co/help/article/choosing-a-custom-domain"
+ target="_blank"
+ className="underline decoration-dotted underline-offset-2 transition-colors hover:text-neutral-700"
+ >
+ dedicated domain
+ </a>
+ </>
+ ),
+ },
+ ]
+ : undefined
+ }
+ cta="Connect domain"
+ />
{product === "partners" && (
<DomainOption
step="domain/subdomain"
icon="https://assets.dub.co/icons/gift.webp"
+ bannerIcon={BoltFill}
+ bannerText="Instant setup"
title={
<>
- Free{" "}
- <span className="rounded border border-neutral-800/10 bg-neutral-100 px-1 py-0.5 font-mono text-xs">
- .dub.link
- </span>{" "}
- subdomain
- </>
- }
- description={
- <>
- Get a free custom domain like{" "}
- <span className="font-mono font-semibold text-neutral-900">
- {workspaceSlug && workspaceSlug.length < 8
- ? workspaceSlug
- : "company"}
- .dub.link
- </span>{" "}
- for your links.
+ Use <DomainChip>.dub.link</DomainChip> subdomain
</>
}
- cta="Claim .dub.link subdomain"
- bannerIcon={BoltFill}
- bannerText="Instant setup"
+ features={[
+ {
+ icon: Flask,
+ text: "Best for testing purposes",
+ },
+ {
+ icon: BoltFill,
+ text: "Instant subdomain setup",
+ },
+ ]}
+ cta="Use .dub.link subdomain"
/>
)}
- <DomainOption
- step="domain/custom"
- icon="https://assets.dub.co/icons/domain-sign.webp"
- title="Connect a custom domain"
- description="Already have a domain? Connect it to your Dub workspace."
- cta="Connect domain"
- />
{product === "links" && (
<DomainOption
step="domain/register"
icon="https://assets.dub.co/icons/gift.webp"
+ bannerIcon={Crown}
+ bannerText="Paid plan required"
title={
<>
- Claim a free{" "}
- <span className="rounded border border-neutral-800/10 bg-neutral-100 px-1 py-0.5 font-mono text-xs">
- .link
- </span>{" "}
- domain
+ Claim a free <DomainChip>.link</DomainChip> domain
</>
}
description={
@@ -82,8 +125,6 @@ export function DefaultDomainSelector() {
</>
}
cta="Claim .link domain"
- bannerIcon={Crown}
- bannerText="Paid plan required"
/>
)}
</div>
@@ -101,60 +142,107 @@ function DomainOption({
icon,
title,
description,
+ features,
cta,
bannerIcon: BannerIcon,
bannerText,
+ bannerVariant = "default",
}: {
step: OnboardingStep;
icon: string;
title: ReactNode;
- description: ReactNode;
+ description?: ReactNode;
+ features?: {
+ icon: Icon;
+ text: ReactNode;
+ }[];
cta: string;
bannerIcon?: Icon;
bannerText?: string;
+ bannerVariant?: "default" | "recommended";
}) {
const plausible = usePlausible();
const { continueTo, isLoading, isSuccessful } = useOnboardingProgress();
return (
- <div className="relative flex h-full flex-col items-center gap-6 rounded-xl border border-neutral-300 p-6 pt-12 transition-all">
- {BannerIcon && bannerText && (
- <div className="absolute inset-x-2 top-2 flex items-center justify-center gap-2 rounded-md border border-neutral-200 bg-neutral-100 px-2.5 py-1 text-xs font-medium text-neutral-600">
- <BannerIcon className="size-3" />
- {bannerText}
+ <div className="relative flex h-full flex-col items-center rounded-xl border border-neutral-200 bg-white p-3 transition-all">
+ <div className="relative flex h-52 w-full items-center justify-center rounded-xl bg-neutral-50">
+ {BannerIcon && bannerText && (
+ <div
+ className={cn(
+ "absolute inset-x-2 top-2 flex h-6 items-center justify-center gap-2 rounded-lg border text-xs font-semibold",
+ bannerVariant === "recommended"
+ ? "border-green-200 bg-green-100 text-green-700"
+ : "border-neutral-200 bg-white text-neutral-700",
+ )}
+ >
+ <BannerIcon
+ className={cn(
+ "size-3.5",
+ bannerVariant === "recommended"
+ ? "text-green-700"
+ : "text-neutral-900",
+ )}
+ />
+ {bannerText}
+ </div>
+ )}
+ <div className="relative mt-8 size-32">
+ <Image
+ src={icon}
+ alt=""
+ fill
+ className="object-contain"
+ fetchPriority="high"
+ />
</div>
- )}
- <div className="relative size-36">
- <Image
- src={icon}
- alt=""
- fill
- className="object-contain"
- fetchPriority="high"
- />
- </div>
- <div className="space-y-2 text-center">
- <span className="text-base font-semibold text-neutral-900">
- {title}
- </span>
- <p className="text-balance text-sm text-neutral-500">{description}</p>
</div>
- <div className="flex w-full grow flex-col justify-end gap-2">
- <Button
- type="button"
- variant="primary"
- className="rounded-lg"
- onClick={() => {
- plausible("Selected Domain", {
- props: {
- domainType: capitalize(step.replace("domain/", "")),
- },
- });
- continueTo(step);
- }}
- loading={isLoading || isSuccessful}
- text={cta}
- />
+ <div className="flex w-full flex-col p-2">
+ <div className="mt-2 space-y-3 text-center">
+ <span className="text-base font-semibold text-neutral-900">
+ {title}
+ </span>
+ {description && (
+ <p className="text-balance text-sm leading-snug text-neutral-500">
+ {description}
+ </p>
+ )}
+ {features && (
+ <div className="mx-auto inline-flex flex-col items-start space-y-2 text-left text-sm text-neutral-500">
+ {features.map(({ icon: FeatureIcon, text }, idx) => (
+ <div key={idx} className="flex items-center gap-2">
+ <FeatureIcon className="size-4 shrink-0 text-neutral-500" />
+ <div>{text}</div>
+ </div>
+ ))}
+ </div>
+ )}
+ </div>
+ <div className="mt-6 flex w-full grow flex-col justify-end">
+ <Button
+ type="button"
+ variant="primary"
+ className="h-10 rounded-lg text-sm"
+ onClick={() => {
+ plausible("Selected Domain", {
+ props: {
+ domainType: capitalize(step.replace("domain/", "")),
+ },
+ });
+ continueTo(step);
+ }}
+ loading={isLoading || isSuccessful}
+ text={cta}
+ />
+ </div>
</div>
</div>
);
}
+
+function DomainChip({ children }: { children: ReactNode }) {
+ return (
+ <span className="rounded border border-neutral-800/10 bg-neutral-100 px-1 py-0.5 font-mono text-xs">
+ {children}
+ </span>
+ );
+}
diff --git a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/page.tsx b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/page.tsx
index 5d75841dd2..beba4253ce 100644
--- a/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/page.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/onboarding/(steps)/domain/page.tsx
@@ -1,23 +1,44 @@
import { StepPage } from "../step-page";
import { DefaultDomainSelector } from "./default-domain-selector";
-export default function Domain() {
+export default async function Domain({
+ searchParams,
+}: {
+ searchParams: Promise<{ product?: string }>;
+}) {
+ const { product } = await searchParams;
+ const isPartners = product !== "links";
+
return (
<StepPage
title="Add a custom domain"
description={
- <>
- Make your links stand out and{" "}
- <a
- href="https://dub.co/blog/custom-domains"
- target="_blank"
- className="cursor-help font-medium underline decoration-dotted underline-offset-2 transition-colors hover:text-neutral-700"
- >
- boost click-through rates by 30%
- </a>
- </>
+ isPartners ? (
+ <>
+ A{" "}
+ <a
+ href="https://dub.co/help/article/choosing-a-custom-domain"
+ target="_blank"
+ className="cursor-help font-medium underline decoration-dotted underline-offset-2 transition-colors hover:text-neutral-700"
+ >
+ dedicated domain
+ </a>{" "}
+ is required for Dub Partner programs, and can be changed at anytime.
+ </>
+ ) : (
+ <>
+ Make your links stand out and{" "}
+ <a
+ href="https://dub.co/blog/custom-domains"
+ target="_blank"
+ className="cursor-help font-medium underline decoration-dotted underline-offset-2 transition-colors hover:text-neutral-700"
+ >
+ boost click-through rates by 30%
+ </a>
+ </>
+ )
}
- className="max-w-none"
+ className="max-w-none [&>div:first-of-type]:max-w-[640px]"
>
<DefaultDomainSelector />
</StepPage>
diff --git a/apps/web/ui/partners/program-link-configuration.tsx b/apps/web/ui/partners/program-link-configuration.tsx
index 44a1fa716b..71b1c851a3 100644
--- a/apps/web/ui/partners/program-link-configuration.tsx
+++ b/apps/web/ui/partners/program-link-configuration.tsx
@@ -1,15 +1,36 @@
import { getLinkStructureOptions } from "@/lib/partners/get-link-structure-options";
+import { mutatePrefix } from "@/lib/swr/mutate";
import useDomains from "@/lib/swr/use-domains";
import useWorkspace from "@/lib/swr/use-workspace";
import { DomainVerificationStatusProps } from "@/lib/types";
import DomainConfiguration from "@/ui/domains/domain-configuration";
import { DomainSelector } from "@/ui/domains/domain-selector";
-import { AnimatedSizeContainer, InfoTooltip, Input, LinkLogo } from "@dub/ui";
+import { CheckCircleFill } from "@/ui/shared/icons";
+import {
+ AnimatedSizeContainer,
+ Button,
+ Globe,
+ InfoTooltip,
+ Input,
+ LinkLogo,
+ Modal,
+ useMediaQuery,
+ Wordmark,
+} from "@dub/ui";
import { ArrowTurnRight2, ChevronRight, LoadingSpinner } from "@dub/ui/icons";
-import { cn, fetcher, getApexDomain, getPrettyUrl } from "@dub/utils";
+import {
+ cn,
+ fetcher,
+ getApexDomain,
+ getPrettyUrl,
+ isWorkspaceBillingTrialActive,
+ truncate,
+} from "@dub/utils";
import { AnimatePresence, motion } from "motion/react";
-import { useMemo, useState } from "react";
+import { FormEvent, useEffect, useMemo, useState } from "react";
+import { toast } from "sonner";
import useSWRImmutable from "swr/immutable";
+import { useDebounce } from "use-debounce";
import { useAddEditDomainModal } from "../modals/add-edit-domain-modal";
import { useRegisterDomainModal } from "../modals/register-domain-modal";
@@ -118,45 +139,40 @@ export function ProgramLinkConfiguration({
}
function DomainOnboarding({ domain, onDomainChange }: DomainProps) {
+ const { slug, trialEndsAt } = useWorkspace();
const { allWorkspaceDomains: domains, loading: isLoadingDomains } =
useDomains();
+ const trialActive = isWorkspaceBillingTrialActive(trialEndsAt);
const [state, setState] = useState<"idle" | "select">(
domain ? "select" : "idle",
);
+ const [showSubdomainModal, setShowSubdomainModal] = useState(false);
- const { RegisterDomainModal, setShowRegisterDomainModal } =
- useRegisterDomainModal({
+ const { AddEditDomainModal, setShowAddEditDomainModal } =
+ useAddEditDomainModal({
onSuccess: (domain) => {
- onDomainChange(domain);
+ onDomainChange(domain.slug);
setState("select");
},
- setRegisteredParam: false,
});
- const { AddEditDomainModal, setShowAddEditDomainModal } =
- useAddEditDomainModal({
+ const { RegisterDomainModal, setShowRegisterDomainModal } =
+ useRegisterDomainModal({
onSuccess: (domain) => {
- onDomainChange(domain.slug);
+ onDomainChange(domain);
setState("select");
},
+ setRegisteredParam: false,
});
const idleOptions = useMemo(
() => [
{
- icon: "https://assets.dub.co/icons/crown.webp",
- title: "Claim a free .link domain",
- badge: "No setup",
+ icon: <Globe className="size-5 text-neutral-900" />,
+ title: "Connect a custom domain",
+ badge: "Recommended",
badgeClassName: "bg-green-100 text-green-800",
- description: "Free for one year with your paid account.",
- onSelect: () => setShowRegisterDomainModal(true),
- },
- {
- icon: "https://assets.dub.co/icons/link.webp",
- title: "Connect a domain you own",
- badge: "DNS setup required",
- badgeClassName: "bg-bg-inverted/10 text-neutral-800",
description:
"Dedicate a domain exclusively for your short links and program.",
onSelect: () => {
@@ -165,12 +181,32 @@ function DomainOnboarding({ domain, onDomainChange }: DomainProps) {
},
loading: isLoadingDomains,
},
+ trialActive
+ ? {
+ icon: <Wordmark className="h-3 text-neutral-900" />,
+ title: "Use .dub.link subdomain",
+ badge: "Instant setup",
+ badgeClassName: "bg-bg-inverted/10 text-neutral-800",
+ description:
+ "A fast way to launch. Switch to a custom domain later.",
+ onSelect: () => setShowSubdomainModal(true),
+ }
+ : {
+ icon: "https://assets.dub.co/icons/crown.webp",
+ title: "Claim a free .link domain",
+ badge: "No setup",
+ badgeClassName: "bg-green-100 text-green-800",
+ description: "Free for one year with your paid account.",
+ onSelect: () => setShowRegisterDomainModal(true),
+ },
],
[
domains,
isLoadingDomains,
+ trialActive,
setShowAddEditDomainModal,
setShowRegisterDomainModal,
+ setShowSubdomainModal,
],
);
@@ -178,6 +214,25 @@ function DomainOnboarding({ domain, onDomainChange }: DomainProps) {
<>
<RegisterDomainModal />
<AddEditDomainModal />
+ <Modal
+ showModal={showSubdomainModal}
+ setShowModal={setShowSubdomainModal}
+ drawerRootProps={{ repositionInputs: false }}
+ className="max-h-[90vh] max-w-md"
+ >
+ <div className="sticky top-0 z-10 border-b border-neutral-200 bg-white px-4 py-4 text-lg font-medium sm:px-6">
+ Use .dub.link subdomain
+ </div>
+ <DubLinkSubdomainForm
+ initialSlug={slug || "company"}
+ onCancel={() => setShowSubdomainModal(false)}
+ onSuccess={(domain) => {
+ onDomainChange(domain);
+ setShowSubdomainModal(false);
+ setState("select");
+ }}
+ />
+ </Modal>
<div>
<div className="mb-2 flex items-center justify-between">
<div className="flex items-center gap-x-2">
@@ -226,11 +281,17 @@ function DomainOnboarding({ domain, onDomainChange }: DomainProps) {
>
<div className="flex items-center gap-3">
<div className="bg-bg-inverted/5 flex size-10 items-center justify-center rounded-lg">
- <img
- src={option.icon}
- alt=""
- className="size-7 object-contain transition-transform ease-out group-hover:scale-105"
- />
+ {typeof option.icon === "string" ? (
+ <img
+ src={option.icon}
+ alt=""
+ className="size-7 object-contain transition-transform ease-out group-hover:scale-105"
+ />
+ ) : (
+ <div className="transition-transform ease-out group-hover:scale-105">
+ {option.icon}
+ </div>
+ )}
</div>
<div className="flex flex-col">
<div className="flex items-center gap-1">
@@ -290,10 +351,242 @@ function DomainOnboarding({ domain, onDomainChange }: DomainProps) {
);
}
+function DubLinkSubdomainForm({
+ initialSlug,
+ onCancel,
+ onSuccess,
+}: {
+ initialSlug: string;
+ onCancel: () => void;
+ onSuccess: (domain: string) => void;
+}) {
+ const workspace = useWorkspace();
+ const { isMobile } = useMediaQuery();
+ const [isChecking, setIsChecking] = useState(false);
+ const [isSubmitting, setIsSubmitting] = useState(false);
+ const [slug, setSlug] = useState(
+ initialSlug.toLowerCase().replace(/[^a-z0-9-]/g, ""),
+ );
+ const [available, setAvailable] = useState<boolean | null>(null);
+ const [debouncedSlug] = useDebounce(slug, 500);
+
+ const domain = `${slug}.dub.link`.toLowerCase();
+ const debouncedDomain = `${debouncedSlug}.dub.link`.toLowerCase();
+ const hasValidatedSlug = slug === debouncedSlug;
+ const isAvailable = available === true && hasValidatedSlug;
+ const canClaim = isAvailable && Boolean(workspace.id);
+
+ useEffect(() => {
+ if (!debouncedSlug.trim()) {
+ setAvailable(null);
+ return;
+ }
+
+ setIsChecking(true);
+ setAvailable(null);
+
+ const controller = new AbortController();
+
+ fetch(`/api/domains/${encodeURIComponent(debouncedDomain)}/validate`, {
+ signal: controller.signal,
+ })
+ .then(async (res) => {
+ if (controller.signal.aborted) return;
+
+ if (!res.ok) {
+ setAvailable(false);
+ return;
+ }
+
+ const data = await res.json();
+ if (!controller.signal.aborted) {
+ setAvailable(data.status === "available");
+ }
+ })
+ .catch((error) => {
+ if (error instanceof DOMException && error.name === "AbortError") {
+ return;
+ }
+
+ setAvailable(false);
+ })
+ .finally(() => {
+ if (!controller.signal.aborted) {
+ setIsChecking(false);
+ }
+ });
+
+ return () => controller.abort();
+ }, [debouncedSlug, debouncedDomain]);
+
+ const claimDomain = async () => {
+ if (!workspace.id) {
+ toast.error("Workspace is still loading. Please try again.");
+ return;
+ }
+
+ setIsSubmitting(true);
+
+ try {
+ const res = await fetch(`/api/domains?workspaceId=${workspace.id}`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify({ slug: domain }),
+ });
+
+ if (!res.ok) {
+ let message = "Failed to add domain.";
+
+ try {
+ const data = await res.json();
+ const error = data?.error;
+
+ if (typeof error === "string") {
+ message = error;
+ } else if (typeof error?.message === "string") {
+ message = error.message;
+ } else if (typeof data?.message === "string") {
+ message = data.message;
+ }
+ } catch {
+ message = "Failed to add domain.";
+ }
+
+ toast.error(message);
+ return;
+ }
+
+ await Promise.all([
+ mutatePrefix("/api/domains"),
+ mutatePrefix("/api/links"),
+ ]);
+ toast.success("Successfully added domain!");
+ onSuccess(domain);
+ } finally {
+ setIsSubmitting(false);
+ }
+ };
+
+ return (
+ <form
+ onSubmit={async (e: FormEvent<HTMLFormElement>) => {
+ e.preventDefault();
+ e.stopPropagation();
+ if (canClaim) await claimDomain();
+ }}
+ >
+ <div className="flex flex-col gap-y-6 px-4 pt-6 text-left sm:px-6">
+ <div>
+ <p className="block text-sm font-medium text-neutral-800">
+ Search domains
+ </p>
+
+ <div className="mt-2">
+ <div
+ className={cn(
+ "-m-1 rounded-[0.625rem] p-1",
+ available === true
+ ? hasValidatedSlug
+ ? "bg-green-100"
+ : "bg-neutral-100"
+ : available === false && hasValidatedSlug
+ ? "bg-orange-100"
+ : "bg-neutral-100",
+ )}
+ >
+ <div className="flex rounded-md border border-neutral-300 bg-white">
+ <input
+ name="domain"
+ id="domain"
+ type="text"
+ required
+ autoComplete="off"
+ className="block w-full rounded-md rounded-r-none border-0 text-neutral-900 placeholder-neutral-400 focus:outline-none focus:ring-0 sm:text-sm"
+ autoFocus={!isMobile}
+ placeholder={initialSlug}
+ value={slug}
+ onChange={(e) => {
+ setSlug(
+ e.target.value.toLowerCase().replace(/[^a-z0-9-]/g, ""),
+ );
+ }}
+ onKeyDown={(e) => {
+ if (e.key === "Enter") e.preventDefault();
+ }}
+ />
+ <span className="inline-flex items-center rounded-md rounded-l-none bg-white pr-3 font-medium text-neutral-500 sm:text-sm">
+ .dub.link
+ </span>
+ </div>
+
+ <AnimatedSizeContainer
+ height
+ transition={{ ease: "easeInOut", duration: 0.1 }}
+ >
+ <div className="flex justify-between gap-3 px-2 pb-2 pt-3 text-sm text-neutral-700">
+ <p>
+ {isAvailable ? (
+ <>
+ <span className="font-semibold text-neutral-800">
+ {domain}
+ </span>{" "}
+ is available.
+ </>
+ ) : available === false && hasValidatedSlug ? (
+ <>
+ <span className="font-semibold text-neutral-800">
+ {domain}
+ </span>{" "}
+ is not available.
+ </>
+ ) : slug.trim() && hasValidatedSlug ? (
+ <>
+ Checking availability for{" "}
+ <strong className="font-semibold">
+ {truncate(domain, 25)}
+ </strong>
+ </>
+ ) : (
+ <>&nbsp;</>
+ )}
+ </p>
+ {(isChecking && hasValidatedSlug) ||
+ (available === null && slug.trim() && hasValidatedSlug) ? (
+ <LoadingSpinner className="mr-0.5 mt-0.5 size-4 shrink-0" />
+ ) : isAvailable ? (
+ <CheckCircleFill className="size-5 shrink-0 text-green-500" />
+ ) : null}
+ </div>
+ </AnimatedSizeContainer>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div className="mt-6 flex justify-end gap-2 border-t border-neutral-200 p-4 sm:px-6">
+ <Button
+ type="button"
+ variant="secondary"
+ text="Cancel"
+ className="h-9 w-fit"
+ onClick={onCancel}
+ />
+ <Button
+ type="submit"
+ text="Claim domain"
+ className="h-9 w-fit"
+ disabled={!canClaim}
+ loading={isSubmitting}
+ />
+ </div>
+ </form>
+ );
+}
+
function DomainOnboardingSelection({
domain,
onDomainChange,
- onBack,
}: DomainProps & { onBack: () => void }) {
const { id: workspaceId } = useWorkspace();
@@ -315,7 +608,7 @@ function DomainOnboardingSelection({
/>
<p className="mt-2 text-xs font-normal text-neutral-500">
- This domain will be used for your program’s referral links
+ This domain will be used for your program's referral links
</p>
<AnimatePresence>