oglasi: v prvi vrstici mreze oglas ni prva celica (na mobilnem sta bila pasica in kartica oglasa zapored pred prvim clankom)

This commit is contained in:
2026-08-30 13:52:25 +02:00
parent 7f7c5e05d1
commit 6a0ef7f2cf
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -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(<ArticleCardAd key={`ad-row-${row}`} />);
+2 -1
View File
@@ -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++}` };
}
}