The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
add Suspense, fix layout shift
Steven Teyff75ab3d461b
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/[[...segments]]/page.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/[[...segments]]/page.tsxindex 7d43179f19..76c6bfdc55 100644--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/[[...segments]]/page.tsx+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/[[...segments]]/page.tsx@@ -1,14 +1,27 @@+import LayoutLoader from "@/ui/layout/layout-loader";import { MarketplaceRouter } from "@/ui/program-marketplace/marketplace-router";+import { Suspense } from "react";-export {- generateStaticParams,- revalidate,-} from "@/ui/program-marketplace/utils/default-exports";+export const dynamic = "force-dynamic";-export default async function MarketplacePage(props: {+export default function MarketplacePage({+ params,+}: {params: Promise<{ segments?: string[] }>;}) {- const { segments } = await props.params;+ return (+ <Suspense fallback={<LayoutLoader />}>+ <MarketplaceSegments params={params} />+ </Suspense>+ );+}++async function MarketplaceSegments({+ params,+}: {+ params: Promise<{ segments?: string[] }>;+}) {+ const { segments = [] } = await params;return <MarketplaceRouter segments={segments} />;}diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/layout.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/layout.tsxdeleted file mode 100644index de6b550241..0000000000--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/layout.tsx+++ /dev/null@@ -1,7 +0,0 @@-"use client";--import { PropsWithChildren } from "react";--export default function MarketplaceLayout({ children }: PropsWithChildren) {- return children;-}diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/loading.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/loading.tsxnew file mode 100644index 0000000000..7ccd211a71--- /dev/null+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/marketplace/loading.tsx@@ -0,0 +1 @@+export { default } from "@/ui/layout/layout-loader";diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-holding-periods.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-holding-periods.tsxindex 756a83c4b6..39ab445828 100644--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-holding-periods.tsx+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/payouts/program-payout-holding-periods.tsx@@ -25,9 +25,6 @@ export type HoldingPeriodUpdate = {type AllGroupsState = { enabled: false } | { enabled: true; days: number };-const HOLDING_PERIOD_DESCRIPTION =- "[Set how long to hold funds](https://dub.co/help/article/partner-payouts#payout-holding-period) before they are eligible for payout. 30 days is recommended.";-// Scroll distance (px) over which the top/bottom fades go from hidden to fully visibleconst FADE_SCROLL_DISTANCE = 40;@@ -174,7 +171,9 @@ export function ProgramPayoutHoldingPeriods({Payout holding period</h4><MarkdownDescription className="text-sm font-medium text-neutral-500">- {HOLDING_PERIOD_DESCRIPTION}+ [Set how long to hold+ funds](https://dub.co/help/article/partner-payouts#payout-holding-period)+ before they are eligible for payout.</MarkdownDescription></div>@@ -185,7 +184,7 @@ export function ProgramPayoutHoldingPeriods({disabled={loading}/><span className="text-sm font-medium text-neutral-900">- Use one holding period for all groups+ Use the same holding period for all groups</span></label>diff --git a/apps/web/ui/layout/sidebar/partner-program-dropdown.tsx b/apps/web/ui/layout/sidebar/partner-program-dropdown.tsxindex bed4d99054..e557adc061 100644--- a/apps/web/ui/layout/sidebar/partner-program-dropdown.tsx+++ b/apps/web/ui/layout/sidebar/partner-program-dropdown.tsx@@ -125,7 +125,7 @@ export function PartnerProgramDropdown() {className="size-5 flex-none shrink-0 overflow-hidden rounded-full"/>)}- <div className="text-content-emphasis min-w-0 truncate text-lg font-semibold">+ <div className="text-content-emphasis min-w-0 truncate text-lg font-semibold leading-7">{selectedProgram?.name || "Your programs"}</div></div>@@ -141,10 +141,17 @@ export function PartnerProgramDropdown() {function PartnerDropdownPlaceholder() {return (- <div className="flex w-full animate-pulse items-center gap-x-2.5 rounded-lg px-2 py-1.5">- <div className="size-6 animate-pulse rounded-full bg-neutral-200" />- <div className="h-7 w-28 grow animate-pulse rounded-md bg-neutral-200" />- <ChevronsUpDown className="h-4 w-4 text-neutral-400" aria-hidden="true" />+ <div className="mb-3">+ <div className="flex w-full items-center justify-between rounded-lg px-2 py-1.5">+ <div className="flex min-w-0 items-center gap-x-2.5 pr-2">+ <div className="size-5 shrink-0 animate-pulse rounded-full bg-neutral-200" />+ <div className="h-7 w-28 animate-pulse rounded-md bg-neutral-200" />+ </div>+ <ChevronsUpDown+ className="size-4 shrink-0 text-neutral-400"+ aria-hidden="true"+ />+ </div></div>);}diff --git a/apps/web/ui/program-marketplace/featured-program-card.tsx b/apps/web/ui/program-marketplace/featured-program-card.tsxindex fe948eb870..1b7d065918 100644--- a/apps/web/ui/program-marketplace/featured-program-card.tsx+++ b/apps/web/ui/program-marketplace/featured-program-card.tsx@@ -56,7 +56,7 @@ export function FeaturedProgramCard({const backgroundColor = accentColor ?? getFeaturedCardBackground(colorIndex);return (- <article className="relative flex h-full flex-col-reverse gap-4 overflow-hidden rounded-2xl p-2 sm:min-h-[340px] sm:flex-row">+ <article className="relative flex h-full flex-col-reverse gap-4 overflow-hidden rounded-2xl border border-neutral-100 p-2 sm:min-h-[340px] sm:flex-row"><divaria-hiddenclassName="pointer-events-none absolute inset-0 z-0 transition-opacity duration-500 ease-out"