From 66bc6dd9dc842e0af6c200ef7a9138f24ba1e877 Mon Sep 17 00:00:00 2001 From: sebastjan Date: Mon, 31 Aug 2026 17:25:38 +0200 Subject: [PATCH] ob visokem oglasu gresta dve vrsti novic: oglas cez dve vrstici, ob njem sest kartic --- client/src/pages/home.tsx | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 80a0ba8..5ac107a 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -1061,7 +1061,35 @@ export default function Home() { - {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 ( + +
+
+ +
+ {ostali.slice(0, 6).map((item) => + item.type === "video" && item.video + ? + : item.article + ? + : null + )} +
+
+ ); + } + if (ri > 0 && gridRows[ri - 1]?.some((it) => it.type === "ad")) return null; + return (
@@ -1096,7 +1124,8 @@ export default function Home() {
- ))} + ); + })} {/* Naslovnica se konca pri 48 clankih, naprej pelje rubrika s stranicenjem. */}