Skip to content

Commit

Permalink
Cleanup Gamegrid
Browse files Browse the repository at this point in the history
  • Loading branch information
KavetiRohith committed Sep 13, 2023
1 parent 31a5636 commit e60c0fa
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/components/GameGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@ interface GameGridProps {
const GameGrid = ({ gameQuery }: GameGridProps) => {
const { games, error, isLoading } = useGames(gameQuery);

if (error) return <Text>{error}</Text>;

return (
<>
{error && <Text>{error}</Text>}
<SimpleGrid
columns={{ sm: 1, md: 2, lg: 3, xl: 4 }}
spacing={6}
padding="10px"
>
{isLoading &&
[0, 1, 2, 3, 4, 5].map((skeleton) => (
<GameCardContainer key={skeleton}>
<GameCardSkeleton />
</GameCardContainer>
))}
{games.map((game) => (
<GameCardContainer key={game.id}>
<GameCard game={game}></GameCard>
<SimpleGrid
columns={{ sm: 1, md: 2, lg: 3, xl: 4 }}
spacing={6}
padding="10px"
>
{isLoading &&
[0, 1, 2, 3, 4, 5].map((skeleton) => (
<GameCardContainer key={skeleton}>
<GameCardSkeleton />
</GameCardContainer>
))}
</SimpleGrid>
</>
{games.map((game) => (
<GameCardContainer key={game.id}>
<GameCard game={game}></GameCard>
</GameCardContainer>
))}
</SimpleGrid>
);
};

Expand Down

0 comments on commit e60c0fa

Please sign in to comment.