Skip to content

Commit cbcdf1a

Browse files
author
Alex Patterson
committed
fix buy buttons
1 parent 1921f2b commit cbcdf1a

1 file changed

Lines changed: 16 additions & 11 deletions

File tree

‎app/(main)/page.tsx‎

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export default async function HomePage() {
2424
</div>
2525
<Link
2626
href={`/${homePage?.featuredCourse?._type}/${homePage?.featuredCourse?.slug}`}
27+
className="w-full"
2728
>
2829
{homePage?.featuredCourse?.coverImage && (
2930
<CoverImage image={homePage?.featuredCourse?.coverImage} priority />
@@ -35,13 +36,16 @@ export default async function HomePage() {
3536
{homePage?.featuredCourse?.excerpt}
3637
</p>
3738
</Link>
38-
<div className="flex flex-col gap-2 min-[400px]:flex-row">
39-
<Buy
40-
stripeProduct={homePage?.featuredCourse?.stripeProduct}
41-
title={homePage?.featuredCourse?.title}
42-
/>
43-
<UserGoProButton />
44-
</div>
39+
{homePage?.featuredCourse?.stripeProduct &&
40+
homePage?.featuredCourse?.title && (
41+
<div className="flex flex-col gap-2 min-[400px]:flex-row">
42+
<Buy
43+
stripeProduct={homePage?.featuredCourse?.stripeProduct}
44+
title={homePage?.featuredCourse?.title}
45+
/>
46+
<UserGoProButton />
47+
</div>
48+
)}
4549
</div>
4650
)}
4751

@@ -52,6 +56,7 @@ export default async function HomePage() {
5256
</div>
5357
<Link
5458
href={`/${homePage?.latestPodcast?._type}/${homePage?.latestPodcast?.slug}`}
59+
className="w-full"
5560
>
5661
{homePage?.latestPodcast?.coverImage && (
5762
<CoverImage image={homePage?.latestPodcast?.coverImage} priority />
@@ -96,14 +101,14 @@ export default async function HomePage() {
96101
<p className="max-w-[600px] text-muted-foreground md:text-xl/relaxed">
97102
{fc?.excerpt}
98103
</p>
99-
{homePage?.featuredCourse?.stripeProduct &&
100-
homePage?.featuredCourse?.title && (
104+
{fc?.stripeProduct &&
105+
fc?.title && (
101106
<div className="flex flex-col gap-2 min-[400px]:flex-row">
102107
<Buy
103108
stripeProduct={
104-
homePage?.featuredCourse?.stripeProduct
109+
fc?.stripeProduct
105110
}
106-
title={homePage?.featuredCourse?.title}
111+
title={fc?.title}
107112
/>
108113
<UserGoProButton />
109114
</div>

0 commit comments

Comments
 (0)