Skip to content

Commit 4df2960

Browse files
author
Alex Patterson
committed
adjust carbon ad, place on podcast pages
1 parent bdabd46 commit 4df2960

2 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎app/(main)/(podcast)/podcast/[slug]/page.tsx‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import PlayerPlayButton from "@/components/player-play-button";
2121
import PodcastOpenSpotify from "@/components/podcast-open-spotify";
2222
import PodcastOpenApple from "@/components/podcast-open-apple";
2323
import PodcastOpenYouTube from "@/components/podcast-open-youtube";
24+
import CarbonAdBanner from "@/components/carbon-ad-banner";
2425

2526
type Props = {
2627
params: { slug: string };
@@ -124,7 +125,7 @@ export default async function PodcastPage({ params }: Props) {
124125
</div>
125126
)}
126127
</div>
127-
{podcast?.sponsor?.length && (
128+
{podcast?.sponsor?.length ? (
128129
<section className="flex flex-col mt-10 mb-10">
129130
<h2 className="mb-4 text-2xl font-bold">Sponsors</h2>
130131
<hr className="border-accent-2" />
@@ -133,6 +134,8 @@ export default async function PodcastPage({ params }: Props) {
133134
</div>
134135
<hr className="border-accent-2" />
135136
</section>
137+
) : (
138+
<CarbonAdBanner />
136139
)}
137140
{podcast?.content?.length && (
138141
<PortableText

‎components/carbon-ad-banner.tsx‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,16 @@ export default function CarbonAdBanner() {
1212
s.src = `//cdn.carbonads.com/carbon.js?serve=CW7DCKJJ&placement=codingcatdev&format=cover`;
1313
reference.current.appendChild(s);
1414
}, []);
15-
return <div className="flex justify-center my-2" ref={reference} />;
15+
return (
16+
<section className="flex flex-col mt-10 mb-10">
17+
<h2 className="mb-4 text-2xl font-bold">Ads</h2>
18+
<hr className="border-accent-2" />
19+
<div className="my-12 ">
20+
<div className="p-4 grid gap-6 md:p-6 grid-flow-col auto-cols-[1fr]">
21+
<div className="flex justify-center my-2" ref={reference} />
22+
</div>
23+
</div>
24+
<hr className="border-accent-2" />
25+
</section>
26+
)
1627
}

0 commit comments

Comments
 (0)