Remove advertisements from the main content grid

Remove the logic that injected ads into the main article grid and update the rendering to no longer display ad components, ensuring only articles and widgets are present.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 1f7e7e89-a520-4970-9645-37daadc466dc
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: bcef02dc-c87d-439a-bac8-229492bf633b
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sebastjanartic 2026-03-05 12:23:58 +00:00
parent 07afec8e0e
commit 5cf60b7d20
2 changed files with 3 additions and 26 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 368 KiB

View File

@ -548,27 +548,6 @@ export default function Home() {
}
}
const totalRows = items.length / 4;
const adRows = [1, 3, 5, 7, 9, 11, 13];
let adCount = 0;
for (const row of adRows) {
if (row >= totalRows) continue;
const rowStart = row * 4;
for (let col = 3; col >= 0; col--) {
if (items[rowStart + col] && items[rowStart + col].type === "article") {
items[rowStart + col] = { type: "ad", key: `ad-${adCount++}` };
break;
}
}
}
if (4 < totalRows) {
const rowStart = 4 * 4;
if (items[rowStart + 1] && items[rowStart + 1].type === "article") {
items[rowStart + 1] = { type: "ad", key: `ad-${adCount++}` };
}
}
return items;
}, [shuffled, widgets]);
@ -685,11 +664,9 @@ export default function Home() {
{row.map((item) =>
item.type === "widget"
? <div key={item.key}>{item.widget!.el}</div>
: item.type === "ad"
? <div key={item.key} className="h-full" data-testid={`ad-grid-${item.key}`}><ArticleCardAd /></div>
: item.article
? <MediumCard key={item.key} article={item.article} focalPoints={focalPoints} />
: null
: item.article
? <MediumCard key={item.key} article={item.article} focalPoints={focalPoints} />
: null
)}
{ri === gridRows.length - 1 && widePickedArticles.length > 0 && (
<div className="sm:col-span-2 lg:col-span-4 grid grid-cols-1 sm:grid-cols-2 gap-4">