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.

Make lander hero section label customizable

Tim Wilsonb1b07d6a3b94
diff --git a/apps/web/lib/zod/schemas/program-lander.ts b/apps/web/lib/zod/schemas/program-lander.ts
index a1b4783d45..2e8c2d2fa5 100644
--- a/apps/web/lib/zod/schemas/program-lander.ts
+++ b/apps/web/lib/zod/schemas/program-lander.ts
@@ -82,6 +82,7 @@ export const programLanderRewardsSchema = z.object({
});
export const programLanderSchema = z.object({
+ label: z.string().optional(),
title: z.string().optional(),
description: z.string().optional(),
rewards: programLanderRewardsSchema.optional(), // TODO: Remove this after partner groups are merged and functional
diff --git a/apps/web/ui/partners/design/modals/edit-hero-modal.tsx b/apps/web/ui/partners/design/modals/edit-hero-modal.tsx
index 46d1398759..dee38570bf 100644
--- a/apps/web/ui/partners/design/modals/edit-hero-modal.tsx
+++ b/apps/web/ui/partners/design/modals/edit-hero-modal.tsx
@@ -68,6 +68,26 @@ function EditHeroModalInner({ setShowEditHeroModal }: EditHeroModalProps) {
</h3>
<div className="mt-4 flex flex-col gap-6">
+ {/* Section label */}
+ <div>
+ <label
+ htmlFor={`${id}-label`}
+ className="flex items-center gap-2 text-sm font-medium text-neutral-700"
+ >
+ Section label
+ </label>
+ <div className="mt-2 rounded-md shadow-sm">
+ <input
+ id={`${id}-label`}
+ type="text"
+ placeholder="Affiliate Program"
+ autoFocus={!isMobile}
+ className="block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
+ {...register("landerData.label")}
+ />
+ </div>
+ </div>
+
{/* Title */}
<div>
<label
diff --git a/apps/web/ui/partners/lander/lander-hero.tsx b/apps/web/ui/partners/lander/lander-hero.tsx
index ffd791c90b..65a57fb8e3 100644
--- a/apps/web/ui/partners/lander/lander-hero.tsx
+++ b/apps/web/ui/partners/lander/lander-hero.tsx
@@ -8,7 +8,7 @@ export function LanderHero({
preview,
}: {
program: Pick<Program, "name">;
- landerData: Pick<ProgramLanderData, "title" | "description">;
+ landerData: Pick<ProgramLanderData, "label" | "title" | "description">;
preview?: boolean;
}) {
const Heading = preview ? "div" : "h1";
@@ -21,7 +21,7 @@ export function LanderHero({
"animate-slide-up-fade [--offset:5px] [animation-duration:1s] [animation-fill-mode:both]",
)}
>
- Affiliate Program
+ {landerData.label || "Affiliate Program"}
</span>
<Heading
className={cn(