From 6a0ef7f2cf0d0fa42ad130b8f511f52c12ec313e Mon Sep 17 00:00:00 2001 From: sebastjan Date: Sun, 30 Aug 2026 13:52:25 +0200 Subject: [PATCH] oglasi: v prvi vrstici mreze oglas ni prva celica (na mobilnem sta bila pasica in kartica oglasa zapored pred prvim clankom) --- client/src/pages/category.tsx | 5 ++++- client/src/pages/home.tsx | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/pages/category.tsx b/client/src/pages/category.tsx index 919667a..9d6bc00 100644 --- a/client/src/pages/category.tsx +++ b/client/src/pages/category.tsx @@ -160,7 +160,10 @@ export default function CategoryPage({ fixedCategory }: { fixedCategory?: string let ai = 0; let row = 0; while (ai < articles.length) { - const adCol = row % 4; + // V prvi vrstici oglas nikoli ne sme biti prva celica: na + // mobilnem je mreza enostolpcna, zato bi bralec po pasici na + // vrhu takoj dobil se en oglas in sele nato prvi clanek. + const adCol = row === 0 ? 3 : row % 4; for (let col = 0; col < 4; col++) { if (col === adCol) { items.push(); diff --git a/client/src/pages/home.tsx b/client/src/pages/home.tsx index 97b0b70..e229dcd 100644 --- a/client/src/pages/home.tsx +++ b/client/src/pages/home.tsx @@ -871,7 +871,8 @@ export default function Home() { const rowStart = r * 4; const hasWidget = items.slice(rowStart, rowStart + 4).some((it) => it.type === "widget"); if (!hasWidget) { - const pos = adCount % 2 === 0 ? 0 : 3; + // Enako kot na straneh rubrik: v prvi vrstici oglas ni prva celica. + const pos = r === 0 ? 3 : adCount % 2 === 0 ? 0 : 3; items[rowStart + pos] = { type: "ad", key: `ad-row-${adCount++}` }; } }