diff --git a/src/components/ResultsBar/ResultsBar.jsx b/src/components/ResultsBar/ResultsBar.jsx index c5f9f86..8dca1c7 100644 --- a/src/components/ResultsBar/ResultsBar.jsx +++ b/src/components/ResultsBar/ResultsBar.jsx @@ -68,30 +68,35 @@ export default function ResultsBar({ }, [setFocusLocation, onResultsBarClose, setData, setLeaderboard] ); - + // Callback function that increases the number of items displayed on the screen by 10 - const handleLoadMore = useCallback(() => { + const handleLoadMore = useCallback(() => { setItemsOnScreenLimit(itemsonScreenLimit + 10); }, [itemsonScreenLimit]); const loadMoreButton = ( ); - + // Retrieve all items that meet the filter criteria const allResults = data.filter(filterItem).map(mapItem); - + // Display only the first 10 items on the screen, all items if there are less than 10 items left to be loaded - const viewableResults = allResults.slice(0, Math.min(itemsonScreenLimit, allResults.length)); + const viewableResults = allResults.slice( + 0, + Math.min(itemsonScreenLimit, allResults.length) + ); // Define JSX for empty results bar (no result cards) const noResults = (