Ensure content displays correctly when viewing articles
Adjust the logic for displaying articles in the carousel to ensure that companion articles are always shown, even when a gallery view is active, eliminating empty space. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 517dfa7b-26ac-463d-a6e1-a58c6df97188 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 57b5fa01-af26-4fc7-ba89-0af18fec8284 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
parent
dab4fd8156
commit
22efad432f
BIN
attached_assets/image_1772311746015.png
Normal file
BIN
attached_assets/image_1772311746015.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 341 KiB |
@ -227,9 +227,13 @@ function FeaturedCarousel({ articles, popular, galleryImages }: { articles: Arti
|
|||||||
|
|
||||||
if (!isGalleryPage && articles.length > 0) {
|
if (!isGalleryPage && articles.length > 0) {
|
||||||
hero = articles[page % articles.length];
|
hero = articles[page % articles.length];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (articles.length > 0) {
|
||||||
|
const offset = isGalleryPage ? 0 : 1;
|
||||||
side = [
|
side = [
|
||||||
articles[(page + 1) % articles.length],
|
articles[(page + offset) % articles.length],
|
||||||
articles[(page + 2) % articles.length],
|
articles[(page + offset + 1) % articles.length],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user