diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 51698a2..8096bc8 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -957,6 +957,19 @@ export default function Home() { return rows; }, [gridItems]); + // Siroka postavitev z dvema novicama: prej samo na koncu mreze, zdaj po + // vsaki tretji vrstici. Clanke jemljemo izza omejitve naslovnice, da se + // nobeden ne ponovi. + const widePairs = useMemo(() => { + const vMrezi = new Set(spaced.slice(0, 48).map((a) => a.id)); + const ostanek = spaced.filter((a) => !vMrezi.has(a.id)); + const pari: Article[][] = []; + for (let i = 0; i + 1 < ostanek.length && pari.length < 6; i += 2) { + pari.push([ostanek[i], ostanek[i + 1]]); + } + return pari; + }, [spaced]); + const widePickedArticles = useMemo(() => { if (!articles || articles.length < 3) return []; const carouselIds = new Set(articles.slice(0, 9).map((a) => a.id)); @@ -1058,6 +1071,12 @@ export default function Home() { ? : null )} + {ri > 0 && (ri + 1) % 3 === 0 && widePairs[Math.floor(ri / 3) % Math.max(1, widePairs.length)] && ( +
+ + +
+ )} {ri === gridRows.length - 1 && widePickedArticles.length > 0 && (