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. */}