Populate empty article slots in the grid with repeated content
Fill empty grid slots in the home page by repeating existing articles to ensure a full layout and improve visual consistency. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 23a4fedf-e948-4b7c-90a5-addc2a9da635 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/f209e72a-0939-48fa-84fc-57854de71967/517dfa7b-26ac-463d-a6e1-a58c6df97188/ls5p9ni Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
daad124140
commit
66a0471447
BIN
attached_assets/image_1772318550164.png
Normal file
BIN
attached_assets/image_1772318550164.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 158 KiB |
@ -494,6 +494,13 @@ export default function Home() {
|
||||
while (ai < shuffled.length) {
|
||||
items.push({ type: "article", article: shuffled[ai++] });
|
||||
}
|
||||
|
||||
const totalSlots = Math.ceil(items.length / 4) * 4;
|
||||
let fill = 0;
|
||||
while (items.length < totalSlots && shuffled.length > 0) {
|
||||
items.push({ type: "article", article: shuffled[fill % shuffled.length] });
|
||||
fill++;
|
||||
}
|
||||
return items;
|
||||
}, [shuffled, widgets]);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user