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.

fix ISR with generateStaticParams

Steven Tey253262541435
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/page.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/page.tsx
index e8817aae4f..11a4c29190 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/[programSlug]/page.tsx
@@ -6,6 +6,7 @@ import { LanderHero } from "@/ui/partners/lander/lander-hero";
import { LanderRewards } from "@/ui/partners/lander/lander-rewards";
import { ProgramCategory } from "@/ui/partners/program-marketplace/program-category";
import { ProgramRewardsDisplay } from "@/ui/partners/program-marketplace/program-rewards-display";
+import { prisma } from "@dub/prisma";
import { ChevronRight, Shop, Tooltip } from "@dub/ui";
import { OG_AVATAR_URL, cn } from "@dub/utils";
import Link from "next/link";
@@ -15,6 +16,23 @@ import { MarketplaceProgramHeaderControls } from "./header-controls";
export const revalidate = 3600; // 1 hour
+export async function generateStaticParams() {
+ const programs = await prisma.program.findMany({
+ where: {
+ addedToMarketplaceAt: {
+ not: null,
+ },
+ },
+ select: {
+ slug: true,
+ },
+ });
+
+ return programs.map((program) => ({
+ programSlug: program.slug,
+ }));
+}
+
export default async function MarketplaceProgramPage(props: {
params: Promise<{ programSlug: string }>;
}) {
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page.tsx
index 01b17f2696..2ae69a05a9 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/page.tsx
@@ -5,7 +5,7 @@ import { ProgramMarketplacePageClient } from "./page-client";
export default function PartnersDashboard() {
return (
<PageContent title="Program Marketplace">
- <PageWidthWrapper className="mb-10">
+ <PageWidthWrapper>
<ProgramMarketplacePageClient />
</PageWidthWrapper>
</PageContent>
diff --git a/packages/email/src/templates/program-marketplace-announcement.tsx b/packages/email/src/templates/program-marketplace-announcement.tsx
index 93282e48ac..310f976304 100644
--- a/packages/email/src/templates/program-marketplace-announcement.tsx
+++ b/packages/email/src/templates/program-marketplace-announcement.tsx
@@ -31,14 +31,10 @@ export default function ProgramMarketplaceAnnouncement({
}
`}</style>
</Head>
- <Preview>
- Dub Program Marketplace is here – discover and apply for programs inside
- Dub.
- </Preview>
+ <Preview>Discover and apply to more programs on Dub.</Preview>
<Tailwind>
<Body className="mx-auto my-auto bg-white font-sans">
<Container className="email-container mx-auto my-10 max-w-[600px] px-10 py-5">
- {/* Header with Dub logo */}
<Section className="mt-2 text-center">
<Img
src={DUB_WORDMARK}
@@ -52,22 +48,19 @@ export default function ProgramMarketplaceAnnouncement({
/>
</Section>
- {/* Main heading */}
<Heading className="mx-0 mb-2 mt-8 p-0 text-center text-2xl font-semibold text-black">
Dub Program Marketplace is here
</Heading>
- {/* Subheading */}
<Text className="mb-8 mt-0 text-center text-base leading-6 text-neutral-600">
- Discover a new way to browse, discover, and apply for
+ A new way to discover, join, and partner with
<br />
- many more programs inside Dub.
+ more programs on Dub.
</Text>
- {/* Visual element */}
<Section className="mb-8 text-center">
<Link
- href="https://partners.dub.co/programs"
+ href="https://partners.dub.co/programs/marketplace"
style={{ textDecoration: "none" }}
>
<Img
@@ -85,19 +78,16 @@ export default function ProgramMarketplaceAnnouncement({
</Link>
</Section>
- {/* Just the beginning section */}
<Heading className="mx-0 mb-3 mt-0 p-0 text-center text-lg font-semibold text-black">
- Just the beginning
+ Over 40+ programs to join
</Heading>
- {/* Body text */}
<Text className="mx-auto mb-8 mt-0 max-w-[420px] text-center text-sm leading-6 text-neutral-600">
- Find programs that fit your audience, compare rewards, and apply
- quickly. It is the easiest way to expand your reach and unlock new
- earning possibilities.
+ Find programs that fit your audience, compare rewards, and submit
+ your application. It is the easiest way to expand your reach and
+ unlock new earning possibilities.
</Text>
- {/* CTA Button */}
<Section className="mb-8 text-center">
<Link
href="https://partners.dub.co/programs"