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.

improve onboarding/payouts

Steven Teyc8155f81e4bb
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 eb82c71c8d..eb010930de 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
@@ -13,7 +13,7 @@ export default function OnboardingVerificationPage() {
Connect payouts
</h1>
<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.
+ Connect your payout method to receive earnings
</p>
<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 />}>
diff --git a/apps/web/ui/partners/payouts/payout-method-cards.tsx b/apps/web/ui/partners/payouts/payout-method-cards.tsx
index 041c10d84a..c59a2d9063 100644
--- a/apps/web/ui/partners/payouts/payout-method-cards.tsx
+++ b/apps/web/ui/partners/payouts/payout-method-cards.tsx
@@ -7,6 +7,7 @@ import type { ComponentType } from "react";
import { ReactNode } from "react";
import { ConnectPayoutButton } from "./connect-payout-button";
import {
+ getPayoutMethodFeaturesForSelector,
PAYOUT_METHODS,
type PayoutMethodFeature,
} from "./payout-method-config";
@@ -57,22 +58,20 @@ export function PayoutMethodSelector({
const isSingleOption = methodCount === 1;
const isCompact = variantProp === "compact";
- const gridClassName = isSingleOption
- ? "w-full"
- : methodCount === 2
- ? "grid gap-3 sm:grid-cols-2"
- : "grid gap-3 sm:grid-cols-3";
-
- const cardVariant = isCompact
- ? "compact"
- : isSingleOption
- ? "spotlight"
- : "default";
-
- const iconSize = isCompact ? "sm" : isSingleOption ? "lg" : "sm";
+ const cardVariant = isCompact ? "compact" : "default";
return (
- <div className={gridClassName}>
+ <div
+ className={cn(
+ methodCount === 2
+ ? "grid gap-3 sm:grid-cols-2"
+ : methodCount === 3
+ ? "grid gap-3 sm:grid-cols-3"
+ : "",
+ // for onboarding payouts page, if single option, limit width to max-w-sm
+ isSingleOption && !isCompact && "mx-auto w-full max-w-sm",
+ )}
+ >
{filteredMethods.map((method) => {
const setting = payoutMethods.find((s) => s.type === method.id)!;
return (
@@ -82,20 +81,20 @@ export function PayoutMethodSelector({
<PayoutMethodIcon
icon={method.icon}
wrapperClasses={method.iconWrapperClass}
- size={iconSize}
+ size="sm"
/>
}
title={method.title}
- features={method.features}
+ features={getPayoutMethodFeaturesForSelector(
+ method.id,
+ isSingleOption,
+ )}
recommended={method.recommended}
action={
<ConnectPayoutButton
payoutMethod={method.id}
connected={setting.connected}
- className={cn(
- "w-full rounded-lg",
- isSingleOption ? "h-10" : "h-9",
- )}
+ className="h-9 w-full rounded-lg"
/>
}
actionFooter={actionFooter?.(setting)}
diff --git a/apps/web/ui/partners/payouts/payout-method-config.ts b/apps/web/ui/partners/payouts/payout-method-config.ts
index e8e3ce5dfd..123eed506e 100644
--- a/apps/web/ui/partners/payouts/payout-method-config.ts
+++ b/apps/web/ui/partners/payouts/payout-method-config.ts
@@ -56,6 +56,43 @@ export const PAYOUT_METHODS = [
},
] as const;
+/** When bank or PayPal is the only choice (e.g. US), avoid international wire copy (FX / 15 days). */
+const SOLO_BANK_FEATURES: PayoutMethodFeature[] = [
+ {
+ icon: CircleDollar,
+ text: "Receive payouts directly in your bank account",
+ },
+ { icon: Zap, text: "1-time no hassle setup" },
+];
+
+const SOLO_PAYPAL_FEATURES: PayoutMethodFeature[] = [
+ {
+ icon: CircleDollar,
+ text: "Receive payouts directly via PayPal",
+ },
+ { icon: Zap, text: "1-time no hassle setup" },
+];
+
+export function getPayoutMethodFeaturesForSelector(
+ methodId: (typeof PAYOUT_METHODS)[number]["id"],
+ isSingleOption: boolean,
+): readonly PayoutMethodFeature[] {
+ const method = PAYOUT_METHODS.find((m) => m.id === methodId);
+ if (!method) {
+ return [];
+ }
+ if (!isSingleOption) {
+ return method.features;
+ }
+ if (methodId === "connect") {
+ return SOLO_BANK_FEATURES;
+ }
+ if (methodId === "paypal") {
+ return SOLO_PAYPAL_FEATURES;
+ }
+ return method.features;
+}
+
const PAYOUT_METHOD_ICON_CONFIG = Object.fromEntries(
PAYOUT_METHODS.map((m) => [
m.id,