From 3f7c8dd2392e2c12b3c928b5fd8a2e3b8cb41d08 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Sun, 27 Jul 2025 15:00:51 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8D=20Add=20Debug=20Logging=20to=20Col?= =?UTF-8?q?lectionThumbnail?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added comprehensive debug logging to understand why card images aren't displaying: - Log collection name, thumbnails data, and custom image - Log mainCard and gridCards data - Add onError and onLoad handlers for images - Log when showing crying emoji placeholder This will help identify if the issue is with data flow or image loading. --- pages/collections.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pages/collections.js b/pages/collections.js index d68e08c..325a9df 100644 --- a/pages/collections.js +++ b/pages/collections.js @@ -253,6 +253,10 @@ export default function Collections() { const CollectionThumbnail = ({ collection }) => { const { thumbnails = [], image } = collection; + console.log('🔍 CollectionThumbnail - collection:', collection.name); + console.log('🔍 CollectionThumbnail - thumbnails:', thumbnails); + console.log('🔍 CollectionThumbnail - image:', image); + // If there's a custom image, show it if (image) { return ( @@ -268,6 +272,7 @@ export default function Collections() { // If no cards, show crying emoji if (!thumbnails || thumbnails.length === 0) { + console.log('🔍 CollectionThumbnail - showing crying emoji (no thumbnails)'); return (
@@ -281,6 +286,9 @@ export default function Collections() { const mainCard = thumbnails[0]; const gridCards = thumbnails.slice(1, 5); // Get up to 4 cards for the 2x2 grid + console.log('🔍 CollectionThumbnail - mainCard:', mainCard); + console.log('🔍 CollectionThumbnail - gridCards:', gridCards); + return (
{/* Main card (larger, left side) */} @@ -291,6 +299,8 @@ export default function Collections() { src={mainCard.image_url || mainCard.stock_image_url} alt={mainCard.name} className="w-full h-full object-cover" + onError={(e) => console.log('🔍 Image load error:', e.target.src)} + onLoad={() => console.log('🔍 Image loaded successfully:', mainCard.image_url || mainCard.stock_image_url)} />
) : ( @@ -311,6 +321,8 @@ export default function Collections() { src={card.image_url || card.stock_image_url} alt={card.name} className="w-full h-full object-cover" + onError={(e) => console.log('🔍 Grid image load error:', e.target.src)} + onLoad={() => console.log('🔍 Grid image loaded successfully:', card.image_url || card.stock_image_url)} />
) : (