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 payout method selector

Steven Teye3f65683bd2f
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx
index e91999aaf2..084310de68 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/payouts/partner-payout-settings-sheet.tsx
@@ -7,10 +7,8 @@ import usePartnerPayoutSettings from "@/lib/swr/use-partner-payout-settings";
import usePartnerProfile from "@/lib/swr/use-partner-profile";
import useProgramEnrollments from "@/lib/swr/use-program-enrollments";
import { partnerPayoutSettingsSchema } from "@/lib/zod/schemas/partners";
-import {
- PAYOUT_METHODS,
- PayoutMethodSelector,
-} from "@/ui/partners/payouts/payout-method-cards";
+import { PayoutMethodSelector } from "@/ui/partners/payouts/payout-method-cards";
+import { PAYOUT_METHODS } from "@/ui/partners/payouts/payout-method-config";
import { PayoutMethodDropdown } from "@/ui/partners/payouts/payout-method-dropdown";
import {
BlurImage,
@@ -225,9 +223,11 @@ function PayoutMethodsSection() {
}
// Show stablecoin as a recommended option when available but not yet connected, to encourage partners to add it
- const showStablecoinRecommended =
- availablePayoutMethods.includes("stablecoin") &&
- !payoutMethodsData?.some((m) => m.type === "stablecoin" && m.connected);
+ // TODO: Add this back when stablecoin is supported in Connect
+ // const showStablecoinRecommended =
+ // availablePayoutMethods.includes("stablecoin") &&
+ // !payoutMethodsData?.some((m) => m.type === "stablecoin" && m.connected);
+ const showStablecoinRecommended = false;
return (
<div>
diff --git a/apps/web/ui/partners/payouts/payout-method-cards.tsx b/apps/web/ui/partners/payouts/payout-method-cards.tsx
index c59a2d9063..58333fcbac 100644
--- a/apps/web/ui/partners/payouts/payout-method-cards.tsx
+++ b/apps/web/ui/partners/payouts/payout-method-cards.tsx
@@ -12,8 +12,6 @@ import {
type PayoutMethodFeature,
} from "./payout-method-config";
-export { PAYOUT_METHODS };
-
const CARD_VARIANTS = {
default: {
card: "p-4",
@@ -55,10 +53,8 @@ export function PayoutMethodSelector({
);
const methodCount = filteredMethods.length;
- const isSingleOption = methodCount === 1;
- const isCompact = variantProp === "compact";
-
- const cardVariant = isCompact ? "compact" : "default";
+ // isSingleOption is true if there is only one method and the variant is not compact
+ const isSingleOption = methodCount === 1 && variantProp !== "compact";
return (
<div
@@ -69,7 +65,7 @@ export function PayoutMethodSelector({
? "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",
+ isSingleOption && "mx-auto w-full max-w-sm",
)}
>
{filteredMethods.map((method) => {
@@ -98,7 +94,7 @@ export function PayoutMethodSelector({
/>
}
actionFooter={actionFooter?.(setting)}
- variant={cardVariant}
+ variant={variantProp}
/>
);
})}
diff --git a/apps/web/ui/partners/payouts/payout-method-config.ts b/apps/web/ui/partners/payouts/payout-method-config.ts
index 07663c3a81..9237f7b35c 100644
--- a/apps/web/ui/partners/payouts/payout-method-config.ts
+++ b/apps/web/ui/partners/payouts/payout-method-config.ts
@@ -12,10 +12,22 @@ import { MapPin, Zap } from "lucide-react";
import type { ComponentType } from "react";
export const PAYOUT_METHODS = [
+ {
+ id: "connect" as const,
+ title: "Bank Account",
+ recommended: false,
+ icon: GreekTemple,
+ iconWrapperClass: "border-[#1717171A] bg-emerald-100 text-emerald-800",
+ features: [
+ { icon: MapPin, text: "Paid in local currency" },
+ { icon: Calendar6, text: "Payouts deposited in 2-5 business days" },
+ { icon: GreekTemple, text: "Local bank account required" },
+ ],
+ },
{
id: "stablecoin" as const,
title: "Stablecoin",
- recommended: true,
+ recommended: false, // TODO: Add this back when stablecoin is supported in Connect
icon: Stablecoin,
iconWrapperClass: "border-[#1717170D] bg-blue-100",
features: [
@@ -27,18 +39,6 @@ export const PAYOUT_METHODS = [
{ icon: Globe, text: "No local bank account required" },
],
},
- {
- id: "connect" as const,
- title: "Bank Account",
- recommended: false,
- icon: GreekTemple,
- iconWrapperClass: "border-[#1717171A] bg-white text-content-emphasis",
- features: [
- { icon: MapPin, text: "Paid in local currency (1% FX fee)" },
- { icon: Calendar6, text: "Payouts take up to 15 business days" },
- { icon: GreekTemple, text: "Local bank account required" },
- ],
- },
{
id: "paypal" as const,
title: "PayPal",
@@ -47,7 +47,7 @@ export const PAYOUT_METHODS = [
iconWrapperClass: "border-[#1717171A] bg-white",
features: [
{ icon: MapPin, text: "Paid in local currency (3% FX fee)" },
- { icon: Zap, text: "Payouts deposited in minutes" },
+ { icon: Zap, text: "Payouts deposited in 5-10 business days" },
{
icon: GreekTemple,
text: "PayPal + local bank account required",