mirror of
https://github.com/mosh-hamedani/game-hub.git
synced 2026-05-21 12:14:32 +02:00
Fix the issue with some games not having platforms
This commit is contained in:
parent
c128ebd4d7
commit
a633036e64
|
|
@ -16,7 +16,7 @@ const GameCard = ({ game }: Props) => {
|
|||
<Image src={getCroppedImageUrl(game.background_image)} />
|
||||
<CardBody>
|
||||
<HStack justifyContent='space-between' marginBottom={3}>
|
||||
<PlatformIconList platforms={game.parent_platforms.map(p => p.platform)} />
|
||||
<PlatformIconList platforms={game.parent_platforms?.map(p => p.platform)} />
|
||||
<CriticScore score={game.metacritic} />
|
||||
</HStack>
|
||||
<Heading fontSize='2xl'>{game.name}<Emoji rating={game.rating_top}/></Heading>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ interface Props {
|
|||
platforms: Platform[];
|
||||
}
|
||||
|
||||
const PlatformIconList = ({ platforms }: Props) => {
|
||||
const PlatformIconList = ({ platforms = [] }: Props) => {
|
||||
const iconMap: { [key: string]: IconType } = {
|
||||
pc: FaWindows,
|
||||
playstation: FaPlaystation,
|
||||
|
|
|
|||
Loading…
Reference in a new issue