diff --git a/src/pages/HomePage.jsx b/src/pages/HomePage.jsx index b7262fe..60ad4c1 100644 --- a/src/pages/HomePage.jsx +++ b/src/pages/HomePage.jsx @@ -1,4 +1,3 @@ -//HomePage.jsx import React, { useEffect, useState, useContext } from 'react'; import { Virtuoso } from 'react-virtuoso'; import CardRow from '../components/CardRow/CardRow'; @@ -35,11 +34,8 @@ function HomePage() { .finally(() => setLoading(false)); }, []); - // Load image for the currently expanded card - useEffect(() => { if (!expandedCardId || cardImages[expandedCardId]) return; - fetchCardImage(expandedCardId) .then(image => setCardImage(expandedCardId, image)) .catch(err => console.error('Failed to load card image', err)); @@ -50,7 +46,6 @@ function HomePage() { const expandedCard = cards.find(c => c.id === expandedCardId); - // Filter + sort using debounced search const filteredCards = cards .filter(card => card.name.toLowerCase().includes(debouncedSearchTerm.toLowerCase()) @@ -58,37 +53,41 @@ function HomePage() { .sort((a, b) => a.name.localeCompare(b.name)); return ( -
Loading image...
+ ) ) : ( -Loading image...
- ) - ) : ( -Click a card to see its image
- )} +Click a card to see its image
+ )} +