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 featured program cards

Steven Tey1897e470634a
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 7a2d7e4641..b21709a5d6 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
@@ -55,28 +55,27 @@ export default async function MarketplaceProgramPage(props: {
}
controls={<MarketplaceProgramHeaderControls program={program} />}
>
- <PageWidthWrapper>
- <div className="relative">
+ <PageWidthWrapper className="pb-20">
+ <div className="border-border-subtle relative overflow-hidden rounded-xl border">
{program.featuredOnMarketplaceAt &&
program.marketplaceHeaderImage && (
- <img
- src={program.marketplaceHeaderImage}
- alt={program.name}
- className="border-border-subtle absolute inset-0 size-full overflow-hidden rounded-xl border object-cover"
- />
- )}
- <div className="relative mx-auto max-w-screen-md py-8">
- <div className="flex items-start justify-between gap-4">
- {program ? (
+ <>
<img
- src={program.logo || `${OG_AVATAR_URL}${program.name}`}
+ src={program.marketplaceHeaderImage}
alt={program.name}
- className="size-16 rounded-full border border-white/20"
+ className="absolute inset-0 size-full object-cover"
/>
- ) : (
- <div className="size-16 animate-pulse rounded-full bg-neutral-200" />
- )}
- </div>
+ {!isDarkImage && (
+ <div className="absolute inset-0 size-full bg-gradient-to-t from-white via-white/75 to-transparent" />
+ )}
+ </>
+ )}
+ <div className="relative mx-auto max-w-screen-md px-4 py-8 sm:px-0">
+ <img
+ src={program.logo || `${OG_AVATAR_URL}${program.name}`}
+ alt={program.name}
+ className="size-16 rounded-full border border-white/20"
+ />
<div className="mt-6 flex flex-col">
<span
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/featured-program-card.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/featured-program-card.tsx
index fa2863825f..3aa9d91f13 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/featured-program-card.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/programs/marketplace/featured-program-card.tsx
@@ -14,7 +14,7 @@ export function FeaturedProgramCard({
const { queryParams } = useRouterStuff();
const router = useRouter();
- const darkImage = program.marketplaceHeaderImage?.includes("-dark");
+ const isDarkImage = program.marketplaceHeaderImage?.includes("-dark");
return (
<div
@@ -28,7 +28,9 @@ export function FeaturedProgramCard({
alt={program.name}
className="absolute inset-0 size-full object-cover"
/>
- <div className="absolute inset-0" />
+ {!isDarkImage && (
+ <div className="absolute inset-0 size-full bg-gradient-to-t from-white via-white/75 to-transparent xl:hidden" />
+ )}
</>
)}
@@ -47,7 +49,7 @@ export function FeaturedProgramCard({
<span
className={cn(
"text-3xl font-semibold",
- darkImage && "text-content-inverted",
+ isDarkImage && "text-content-inverted",
)}
>
{program.name}
@@ -55,8 +57,8 @@ export function FeaturedProgramCard({
<div
className={cn(
- "mt-1 max-w-sm text-sm",
- darkImage && "text-content-inverted",
+ "mt-1 line-clamp-2 max-w-sm text-sm",
+ isDarkImage && "text-content-inverted",
)}
>
{program.description ||
@@ -69,7 +71,7 @@ export function FeaturedProgramCard({
<span
className={cn(
"text-content-subtle block text-xs font-medium",
- darkImage && "text-content-inverted/80",
+ isDarkImage && "text-content-inverted/80",
)}
>
Rewards
@@ -77,7 +79,7 @@ export function FeaturedProgramCard({
<ProgramRewardsDisplay
rewards={program.rewards}
discount={program.discount}
- isDarkImage={darkImage}
+ isDarkImage={isDarkImage}
onRewardClick={(reward) =>
queryParams({
set: {
@@ -105,7 +107,7 @@ export function FeaturedProgramCard({
<span
className={cn(
"text-content-subtle block text-xs font-medium",
- darkImage && "text-content-inverted/80",
+ isDarkImage && "text-content-inverted/80",
)}
>
Category
@@ -125,7 +127,7 @@ export function FeaturedProgramCard({
}
className={cn(
"hover:bg-bg-default/10 active:bg-bg-default/20",
- darkImage && "text-content-inverted",
+ isDarkImage && "text-content-inverted",
)}
/>
))}
@@ -153,7 +155,7 @@ export function FeaturedProgramCard({
<div
className={cn(
"-ml-1.5 flex size-6 items-center justify-center rounded-md text-xs font-medium",
- darkImage && "text-content-inverted/80",
+ isDarkImage && "text-content-inverted/80",
)}
>
+{program.categories.length - 1}