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.

add one-time billing period to EarningsCalculatorBlock

Steven Tey13ccba5149b4
diff --git a/apps/web/lib/zod/schemas/program-lander.ts b/apps/web/lib/zod/schemas/program-lander.ts
index 01dbad9bd7..3ac9cca07a 100644
--- a/apps/web/lib/zod/schemas/program-lander.ts
+++ b/apps/web/lib/zod/schemas/program-lander.ts
@@ -67,7 +67,7 @@ export const programLanderEarningsCalculatorBlockSchema =
type: z.literal("earnings-calculator"),
data: z.object({
productPrice: z.number().describe("Average product price in cents"),
- billingPeriod: z.enum(["monthly", "yearly"]).optional(),
+ billingPeriod: z.enum(["monthly", "yearly", "one-time"]).optional(),
}),
});
diff --git a/apps/web/ui/partners/groups/design/lander/modals/earnings-calculator-block-modal.tsx b/apps/web/ui/partners/groups/design/lander/modals/earnings-calculator-block-modal.tsx
index 85d85c73b9..98e07a74d4 100644
--- a/apps/web/ui/partners/groups/design/lander/modals/earnings-calculator-block-modal.tsx
+++ b/apps/web/ui/partners/groups/design/lander/modals/earnings-calculator-block-modal.tsx
@@ -127,10 +127,10 @@ function EarningsCalculatorBlockModalInner({
</div>
</div>
- {/* Earnings time toggle */}
+ {/* Billing period toggle */}
<div>
<label className="text-sm font-medium text-neutral-700">
- Earnings time
+ Billing period
</label>
<div className="mt-2">
<Controller
@@ -141,10 +141,11 @@ function EarningsCalculatorBlockModalInner({
options={[
{ value: "monthly", label: "Monthly" },
{ value: "yearly", label: "Yearly" },
+ { value: "one-time", label: "One-time" },
]}
selected={field.value ?? "monthly"}
selectAction={(value) => field.onChange(value)}
- className="grid w-full grid-cols-2 rounded-lg border-none bg-neutral-100 p-0.5"
+ className="grid w-full grid-cols-3 rounded-lg border-none bg-neutral-100 p-0.5"
optionClassName="flex h-9 justify-center"
indicatorClassName="rounded-md border-none bg-white shadow-[0px_0px_2px_0px_rgba(0,0,0,0.05),0px_2px_6px_0px_rgba(0,0,0,0.1)]"
/>
diff --git a/apps/web/ui/partners/lander/blocks/earnings-calculator-block.tsx b/apps/web/ui/partners/lander/blocks/earnings-calculator-block.tsx
index 042c9b4072..1aaccd2949 100644
--- a/apps/web/ui/partners/lander/blocks/earnings-calculator-block.tsx
+++ b/apps/web/ui/partners/lander/blocks/earnings-calculator-block.tsx
@@ -63,9 +63,11 @@ export function EarningsCalculatorBlock({
className="text-5xl font-medium leading-[48px] tracking-[-0.96px] text-neutral-800"
prefix="$"
/>
- <span className="text-base font-semibold leading-6 tracking-[-0.32px] text-neutral-700">
- / {isYearly ? "yr" : "mo"}
- </span>
+ {block.data.billingPeriod !== "one-time" && (
+ <span className="text-base font-semibold leading-6 tracking-[-0.32px] text-neutral-700">
+ / {isYearly ? "year" : "month"}
+ </span>
+ )}
</div>
</div>