Add an advertisement to the blog post grid layout
Insert an ad into the fifth row of the blog post grid, replacing an article at the second position. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: c5a7bcf0-0aea-463e-aa1c-d846d197312b Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/nFw7xof Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
ac94327532
commit
8f709e181d
@ -492,6 +492,13 @@ export default function Home() {
|
||||
}
|
||||
}
|
||||
|
||||
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]);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user