ob visokem oglasu gresta dve vrsti novic: oglas cez dve vrstici, ob njem sest kartic

This commit is contained in:
2026-08-31 17:25:38 +02:00
parent 5bc16ae27f
commit 66bc6dd9dc
+31 -2
View File
@@ -1061,7 +1061,35 @@ export default function Home() {
</div>
</div>
{gridRows.map((row, ri) => (
{gridRows.map((row, ri) => {
// Oglas je visok kot dve kartici, zato vrstico z oglasom zdruzimo z
// naslednjo: oglas zasede levi stolpec cez dve vrstici, ob njem pa
// gresta dve vrsti novic (sest kartic). Prej je pod tremi karticami
// ob visokem oglasu ostal prazen prostor.
const jeOglasna = row.some((it) => it.type === "ad");
const naslednja = gridRows[ri + 1] || [];
if (jeOglasna && naslednja.length === 4 && !naslednja.some((it) => it.type === "ad" || it.type === "widget")) {
const oglas = row.find((it) => it.type === "ad")!;
const ostali = [...row.filter((it) => it.type !== "ad"), ...naslednja];
return (
<LazySection key={`ad-block-${ri}`} minHeight="560px">
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
<div className="lg:row-span-2 h-full empty:hidden" data-testid={`ad-grid-${oglas.key}`}>
<ArticleCardAd />
</div>
{ostali.slice(0, 6).map((item) =>
item.type === "video" && item.video
? <VideoCard key={item.key} video={item.video} />
: item.article
? <MediumCard key={item.key} article={item.article} focalPoints={focalPoints} />
: null
)}
</div>
</LazySection>
);
}
if (ri > 0 && gridRows[ri - 1]?.some((it) => it.type === "ad")) return null;
return (
<LazySection key={`row-group-${ri}`} minHeight="280px">
<div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4">
@@ -1096,7 +1124,8 @@ export default function Home() {
</div>
</div>
</LazySection>
))}
);
})}
{/* Naslovnica se konca pri 48 clankih, naprej pelje rubrika s stranicenjem. */}
<div className="flex justify-center my-8">