Skip to content

Commit

Permalink
bug correction
Browse files Browse the repository at this point in the history
- corrected the bug where the MMORPG category was not showing the correct amount of games
- fixed the number displayed on the search bar on the home component
  • Loading branch information
VelzckC0D3 committed Jun 6, 2023
1 parent 53b2d9a commit d822daf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/CategoryButtons.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ const CategoryButtons = ({ category, handleCategoryChange }) => {
displayedGameCount = Math.min(displayedGameCount, 149);
} else if (category.toLowerCase() === 'sports') {
displayedGameCount = Math.min(displayedGameCount, 8);
} else if (category.toLowerCase() === 'mmo') {
displayedGameCount = Math.max(displayedGameCount, 154);
}

setGameCount(displayedGameCount);
Expand Down
3 changes: 1 addition & 2 deletions src/components/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import '../style/Home.css';

const Home = ({ handleCategoryChange }) => {
const filteredCategories = ['shooter', 'strategy', 'card', 'fighting', 'mmorpg', 'moba', 'racing', 'mmo', 'sports', 'social'];
const categoryNumber = filteredCategories.length;

const [searchQuery, setSearchQuery] = useState('');

Expand Down Expand Up @@ -37,7 +36,7 @@ const Home = ({ handleCategoryChange }) => {
/>
<AiOutlineSearch className="searchIcon" />
<p className="currentGame">
{`(${categoryNumber})`}
{`(${filteredCategoriesBySearch.length})`}
{' '}
Categories Found
</p>
Expand Down

0 comments on commit d822daf

Please sign in to comment.