strani rubrik: oglas cez dve vrstici in vrstice po 292 px, da kartic ne razteguje
This commit is contained in:
@@ -153,7 +153,10 @@ export default function CategoryPage({ fixedCategory }: { fixedCategory?: string
|
|||||||
</div>
|
</div>
|
||||||
) : data && data.articles.length > 0 ? (
|
) : data && data.articles.length > 0 ? (
|
||||||
<>
|
<>
|
||||||
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5">
|
{/* Oglas je fiksen 300x600 in bi vrstico raztegnil na svojo visino.
|
||||||
|
Zato so vrstice zaklenjene na 292 px, oglas pa zasede dve, tako
|
||||||
|
da se visini ujameta in pod karticami ni praznega prostora. */}
|
||||||
|
<div className="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5 lg:auto-rows-[292px]">
|
||||||
{(() => {
|
{(() => {
|
||||||
const items: React.ReactNode[] = [];
|
const items: React.ReactNode[] = [];
|
||||||
const articles = data.articles;
|
const articles = data.articles;
|
||||||
@@ -166,7 +169,7 @@ export default function CategoryPage({ fixedCategory }: { fixedCategory?: string
|
|||||||
const adCol = row === 0 ? 3 : row % 4;
|
const adCol = row === 0 ? 3 : row % 4;
|
||||||
for (let col = 0; col < 4; col++) {
|
for (let col = 0; col < 4; col++) {
|
||||||
if (col === adCol) {
|
if (col === adCol) {
|
||||||
items.push(<ArticleCardAd key={`ad-row-${row}`} />);
|
items.push(<div key={`ad-row-${row}`} className="lg:row-span-2 h-full"><ArticleCardAd /></div>);
|
||||||
} else if (ai < articles.length) {
|
} else if (ai < articles.length) {
|
||||||
const a = articles[ai];
|
const a = articles[ai];
|
||||||
items.push(
|
items.push(
|
||||||
|
|||||||
Reference in New Issue
Block a user