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.

Partner onboarding (#3770)

Marcus Farrell84af4e196df8
diff --git a/apps/web/app/(ee)/partners.dub.co/(onboarding)/layout.tsx b/apps/web/app/(ee)/partners.dub.co/(onboarding)/layout.tsx
index ec0d571b1c..a5f0e3cbe6 100644
--- a/apps/web/app/(ee)/partners.dub.co/(onboarding)/layout.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(onboarding)/layout.tsx
@@ -48,10 +48,14 @@ export default function PartnerOnboardingLayout({
))}
</div>
- <div className="relative flex min-h-[100dvh] min-h-screen w-full flex-col items-center justify-between">
- <div className="grow basis-0">
- <div className="pt-4">
- <Link href="https://dub.co/home" target="_blank" className="block">
+ <div className="relative flex min-h-[100dvh] min-h-screen w-full flex-col items-center overflow-hidden md:justify-between">
+ <div className="w-full px-4 md:grow md:basis-0 md:px-0">
+ <div className="flex justify-center pt-4">
+ <Link
+ href="https://dub.co/home"
+ target="_blank"
+ className="block w-fit"
+ >
<Wordmark className="h-8" />
<div className="text-center text-sm font-semibold text-black/80">
Partners
@@ -60,14 +64,23 @@ export default function PartnerOnboardingLayout({
</div>
</div>
- <div className="w-full py-16">{children}</div>
+ <div className="w-full flex-1 overflow-y-auto md:flex-none md:overflow-visible">
+ <div className="w-full pt-8 pb-8 sm:pb-4 md:py-16 px-5 md:px-0">{children}</div>
+ </div>
+
+ <div className="w-full md:hidden">
+ <SignedInHint />
+ </div>
{/* Empty div to center main content */}
- <div className="grow basis-0" />
+ <div className="hidden md:block md:grow md:basis-0" />
+ </div>
+
+ <div className="hidden md:block">
+ <SignedInHint />
</div>
<Toolbar show={["help"]} />
- <SignedInHint />
</>
);
}
diff --git a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/onboarding-form.tsx b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/onboarding-form.tsx
index 26228afd88..254b59547d 100644
--- a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/onboarding-form.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/onboarding-form.tsx
@@ -148,7 +148,7 @@ export function OnboardingForm({
render={({ field }) => (
<FileUpload
accept="images"
- className="mt-1.5 size-20 rounded-full border border-neutral-300"
+ className="mt-1.5 size-20 shrink-0 rounded-full border border-neutral-300 transition-[border-color,box-shadow] focus-within:border-neutral-500 focus-within:ring-1 focus-within:ring-neutral-500"
iconClassName="size-5"
previewClassName="size-20 rounded-full"
variant="plain"
@@ -162,11 +162,11 @@ export function OnboardingForm({
)}
/>
<div>
- <p className="text-xs text-neutral-500">
- Square image recommended, up to 2 MB.
+ <p className="text-xs font-medium text-neutral-600">
+ Visible to programs and helps with approvals
</p>
- <p className="mt-0.5 text-xs font-medium text-neutral-500">
- Adding an image can improve your approval rates.
+ <p className="mt-0.5 text-xs text-neutral-500">
+ Max 2 MB
</p>
</div>
</div>
@@ -218,7 +218,7 @@ export function OnboardingForm({
<label>
<span className="text-sm font-medium text-neutral-800">
- Description
+ About you
<span className="font-normal text-neutral-500"> (optional)</span>
</span>
<div>
@@ -229,7 +229,7 @@ export function OnboardingForm({
? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"
: "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",
)}
- placeholder="Tell us about the kind of content you create – e.g. tech, travel, fashion, etc."
+ placeholder="Share who you are, what you do, and who your audience is."
maxLength={MAX_PARTNER_DESCRIPTION_LENGTH}
minRows={3}
onKeyDown={handleKeyDown}
diff --git a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/page.tsx b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/page.tsx
index 77ee733f41..eb38c5281b 100644
--- a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/page.tsx
@@ -5,11 +5,11 @@ import { OnboardingForm } from "./onboarding-form";
export default function PartnerOnboarding() {
return (
- <div className="mx-auto flex w-full max-w-[480px] flex-col items-center md:mt-4">
- <h1 className="animate-slide-up-fade text-lg font-medium [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <div className="mx-auto flex w-full max-w-[430px] flex-col items-center md:mt-4">
+ <h1 className="animate-slide-up-fade text-center text-xl font-semibold [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
Create your partner profile
</h1>
- <div className="animate-slide-up-fade w-full rounded-xl p-8 [--offset:10px] [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <div className="animate-slide-up-fade w-full pt-8 [--offset:10px] [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
<Suspense fallback={<OnboardingForm />}>
<OnboardingFormRSC />
</Suspense>
diff --git a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/payouts/page.tsx b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/payouts/page.tsx
index a952c01ca5..5bc75fcc98 100644
--- a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/payouts/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/payouts/page.tsx
@@ -8,14 +8,14 @@ import { Suspense } from "react";
export default function OnboardingVerificationPage() {
return (
- <div className="relative mx-auto my-10 flex w-full max-w-[640px] flex-col items-center px-4 text-center sm:px-6 md:mt-6">
- <h1 className="animate-slide-up-fade text-content-emphasis text-xl font-semibold [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <div className="relative mx-auto flex w-full max-w-[600px] flex-col items-center text-center md:mt-6">
+ <h1 className="animate-slide-up-fade text-content-emphasis text-xl text-center font-semibold [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
Connect payouts
</h1>
- <p className="animate-slide-up-fade mt-1 text-base font-medium text-neutral-500 [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <p className="animate-slide-up-fade mt-1 text-center text-base text-neutral-500 [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
Connect your preferred payout method to receive payments.
</p>
- <div className="animate-slide-up-fade relative mt-12 w-full [--offset:10px] [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <div className="animate-slide-up-fade relative mt-10 w-full [--offset:10px] [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
<Suspense fallback={<PayoutSkeleton />}>
<PayoutRSC />
</Suspense>
diff --git a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/platforms/page.tsx b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/platforms/page.tsx
index 7c0619045b..014ef757ec 100644
--- a/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/platforms/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(onboarding)/onboarding/platforms/page.tsx
@@ -11,20 +11,22 @@ import { OnboardingPlatformsPageClient } from "./page-client";
export default function OnboardingPlatformsPage() {
return (
- <div className="relative mx-auto w-full max-w-[416px] text-center md:mt-4">
- <h1 className="animate-slide-up-fade text-lg font-medium [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <div className="mx-auto flex w-full max-w-[430px] flex-col text-center md:mt-4">
+ <h1 className="animate-slide-up-fade text-center text-xl font-semibold [--offset:8px] [animation-delay:250ms] [animation-duration:1s] [animation-fill-mode:both]">
Your social and web platforms
</h1>
- <p className="animate-slide-up-fade text-content-subtle mt-1 text-sm [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <p className="animate-slide-up-fade text-content-subtle mt-1 text-base [animation-delay:500ms] [animation-duration:1s] [animation-fill-mode:both]">
Verifying your social and web platforms will improve your reputation
score and rank you higher in our partner network.
</p>
- <div className="animate-slide-up-fade mt-8 grid gap-4 [animation-delay:750ms] [animation-duration:1s] [animation-fill-mode:both]">
- <Suspense fallback={<PartnerPlatformsForm partner={null} />}>
- <OnboardingPlatformsFormRSC />
- </Suspense>
+ <div className="animate-slide-up-fade w-full rounded-xl py-8 [animation-delay:750ms] [animation-duration:1s] [animation-fill-mode:both]">
+ <div className="grid gap-4">
+ <Suspense fallback={<PartnerPlatformsForm partner={null} />}>
+ <OnboardingPlatformsFormRSC />
+ </Suspense>
+ </div>
</div>
</div>
);
diff --git a/apps/web/app/app.dub.co/(onboarding)/signed-in-hint.tsx b/apps/web/app/app.dub.co/(onboarding)/signed-in-hint.tsx
index cf27f0d00b..4383536c78 100644
--- a/apps/web/app/app.dub.co/(onboarding)/signed-in-hint.tsx
+++ b/apps/web/app/app.dub.co/(onboarding)/signed-in-hint.tsx
@@ -1,6 +1,6 @@
"use client";
-import { Button } from "@dub/ui";
+import { Button, CircleQuestion } from "@dub/ui";
import { signOut, useSession } from "next-auth/react";
import { useState } from "react";
@@ -9,27 +9,40 @@ export function SignedInHint() {
const [isLoading, setIsLoading] = useState(false);
return (
- <div className="fixed bottom-0 left-0 z-40 m-5 flex flex-col gap-2">
- <div className="flex items-center gap-1 text-xs text-neutral-600">
- You're signed in as{" "}
- {session ? (
- <b className="text-neutral-800">{session.user?.email}</b>
- ) : (
- <span className="h-3 w-32 animate-pulse rounded-md border border-neutral-300 bg-neutral-200" />
- )}
+ <div className="w-full border-t border-neutral-200 bg-white p-4 md:fixed md:bottom-0 md:left-0 md:z-40 md:m-5 md:w-auto md:border-0 md:bg-transparent md:p-0">
+ <div className="mx-auto flex w-full flex-col gap-2 md:mx-0 md:w-auto md:max-w-none">
+ <p className="text-xs text-neutral-600">
+ You're signed in as{" "}
+ {session ? (
+ <b className="break-all text-neutral-800">{session.user?.email}</b>
+ ) : (
+ <span className="h-3 w-32 animate-pulse rounded-md border border-neutral-300 bg-neutral-200" />
+ )}
+ </p>
+
+ <div className="flex items-center justify-between gap-2 md:block">
+ <Button
+ variant="secondary"
+ text="Sign in as a different user"
+ onClick={() => {
+ setIsLoading(true);
+ signOut({
+ callbackUrl: "/login",
+ });
+ }}
+ loading={isLoading}
+ className="h-8 w-fit rounded-lg px-3 text-xs shadow-sm"
+ />
+ <a
+ href="https://dub.co/contact/support"
+ target="_blank"
+ className="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg border border-neutral-200 bg-white text-neutral-700 shadow-sm transition-colors hover:bg-neutral-100 md:hidden"
+ aria-label="Help"
+ >
+ <CircleQuestion className="size-5" strokeWidth={2} />
+ </a>
+ </div>
</div>
- <Button
- variant="secondary"
- text="Sign in as a different user"
- onClick={() => {
- setIsLoading(true);
- signOut({
- callbackUrl: "/login",
- });
- }}
- loading={isLoading}
- className="h-8 w-fit rounded-lg px-3 text-xs shadow-sm"
- />
</div>
);
}
diff --git a/apps/web/playwright/partners/onboarding.spec.ts b/apps/web/playwright/partners/onboarding.spec.ts
index 3e46d57c2f..ef8dc68922 100644
--- a/apps/web/playwright/partners/onboarding.spec.ts
+++ b/apps/web/playwright/partners/onboarding.spec.ts
@@ -19,9 +19,7 @@ test.describe("Partner onboarding", () => {
await expect(page.locator('input[name="name"]').first()).toBeVisible();
await expect(page.getByText("Profile image")).toBeVisible();
await expect(page.getByLabel("Country")).toBeVisible();
- await expect(
- page.getByLabel(/Description/, { exact: false }),
- ).toBeVisible();
+ await expect(page.getByText("About you")).toBeVisible();
await expect(page.getByText("Profile Type")).toBeVisible();
await expect(page.getByRole("button", { name: "Continue" })).toBeVisible();
});
diff --git a/apps/web/ui/layout/sidebar/help-button.tsx b/apps/web/ui/layout/sidebar/help-button.tsx
index a3b692d05c..e0c37d2076 100644
--- a/apps/web/ui/layout/sidebar/help-button.tsx
+++ b/apps/web/ui/layout/sidebar/help-button.tsx
@@ -1,11 +1,21 @@
import { CircleQuestion } from "@dub/ui";
+import { cn } from "@dub/utils";
-export async function HelpButton() {
+export async function HelpButton({
+ variant = "default",
+}: {
+ variant?: "default" | "secondary";
+}) {
return (
<a
href="https://dub.co/contact/support"
target="_blank"
- className="text-content-default hover:bg-bg-inverted/5 flex size-11 shrink-0 items-center justify-center rounded-lg"
+ className={cn(
+ "shrink-0 items-center justify-center rounded-lg",
+ variant === "secondary"
+ ? "flex h-8 w-8 border border-neutral-200 bg-white text-neutral-700 shadow-sm transition-colors hover:bg-neutral-100"
+ : "text-content-default hover:bg-bg-inverted/5 flex size-11",
+ )}
>
<CircleQuestion className="size-5" strokeWidth={2} />
</a>
diff --git a/apps/web/ui/layout/toolbar/toolbar.tsx b/apps/web/ui/layout/toolbar/toolbar.tsx
index 162e8f1451..84ada930ad 100644
--- a/apps/web/ui/layout/toolbar/toolbar.tsx
+++ b/apps/web/ui/layout/toolbar/toolbar.tsx
@@ -17,8 +17,8 @@ export default function Toolbar(props: ToolbarProps) {
</div>
)}
{props.show?.includes("help") && (
- <div className="shrink-0">
- <HelpButton />
+ <div className="hidden shrink-0 md:block">
+ <HelpButton variant="secondary" />
</div>
)}
</div>
diff --git a/apps/web/ui/partners/partner-platforms-form.tsx b/apps/web/ui/partners/partner-platforms-form.tsx
index 0621f53183..ef7c42f288 100644
--- a/apps/web/ui/partners/partner-platforms-form.tsx
+++ b/apps/web/ui/partners/partner-platforms-form.tsx
@@ -326,24 +326,26 @@ export const PartnerPlatformsForm = forwardRef<
<span className="inline-flex items-center rounded-l-md border border-r-0 border-neutral-300 bg-neutral-50 px-3 text-neutral-500 sm:text-sm">
youtube.com
</span>
- <span className="absolute inset-y-0 left-[6.7rem] flex items-center pl-3 text-sm text-neutral-400">
- @
- </span>
- <input
- type="text"
- disabled={disabled}
- className={cn(
- "block w-full rounded-none rounded-r-md pl-7 focus:outline-none sm:text-sm",
- disabled &&
- "cursor-not-allowed bg-neutral-50 text-neutral-400",
- errors.youtube
- ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"
- : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",
- )}
- placeholder="handle"
- onPaste={(e) => onPasteSocial(e, "youtube")}
- {...register("youtube")}
- />
+ <div className="relative w-full">
+ <span className="pointer-events-none absolute inset-y-0 left-3 flex items-center text-sm text-neutral-400">
+ @
+ </span>
+ <input
+ type="text"
+ disabled={disabled}
+ className={cn(
+ "block w-full rounded-none rounded-r-md pl-7 focus:outline-none sm:text-sm",
+ disabled &&
+ "cursor-not-allowed bg-neutral-50 text-neutral-400",
+ errors.youtube
+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"
+ : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",
+ )}
+ placeholder="handle"
+ onPaste={(e) => onPasteSocial(e, "youtube")}
+ {...register("youtube")}
+ />
+ </div>
</div>
}
variant={variant}
@@ -461,24 +463,26 @@ export const PartnerPlatformsForm = forwardRef<
<span className="inline-flex items-center rounded-l-md border border-r-0 border-neutral-300 bg-neutral-50 px-3 text-neutral-500 sm:text-sm">
tiktok.com
</span>
- <span className="absolute inset-y-0 left-[5.7rem] flex items-center pl-3 text-sm text-neutral-400">
- @
- </span>
- <input
- type="text"
- disabled={disabled}
- className={cn(
- "block w-full rounded-none rounded-r-md pl-7 focus:outline-none sm:text-sm",
- disabled &&
- "cursor-not-allowed bg-neutral-50 text-neutral-400",
- errors.tiktok
- ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"
- : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",
- )}
- placeholder="handle"
- onPaste={(e) => onPasteSocial(e, "tiktok")}
- {...register("tiktok")}
- />
+ <div className="relative w-full">
+ <span className="pointer-events-none absolute inset-y-0 left-3 flex items-center text-sm text-neutral-400">
+ @
+ </span>
+ <input
+ type="text"
+ disabled={disabled}
+ className={cn(
+ "block w-full rounded-none rounded-r-md pl-7 focus:outline-none sm:text-sm",
+ disabled &&
+ "cursor-not-allowed bg-neutral-50 text-neutral-400",
+ errors.tiktok
+ ? "border-red-300 pr-10 text-red-900 placeholder-red-300 focus:border-red-500 focus:ring-red-500"
+ : "border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:ring-neutral-500",
+ )}
+ placeholder="handle"
+ onPaste={(e) => onPasteSocial(e, "tiktok")}
+ {...register("tiktok")}
+ />
+ </div>
</div>
}
variant={variant}