degmods.com/src/components/GameCard.tsx
daniyal f7bf65c845
All checks were successful
Release to Staging / build_and_release (push) Successful in 50s
fix: in mod detail page fixed navigation for game route and edit mod
2024-09-25 21:12:42 +05:00

29 lines
679 B
TypeScript

import { Link } from 'react-router-dom'
import { getGamePageRoute } from 'routes'
import '../styles/cardGames.css'
import { handleGameImageError } from '../utils'
type GameCardProps = {
title: string
imageUrl: string
}
export const GameCard = ({ title, imageUrl }: GameCardProps) => {
const route = getGamePageRoute(title)
return (
<Link className='cardGameMainWrapperLink' to={route}>
<div className='cardGameMainWrapper'>
<img
src={imageUrl}
onError={handleGameImageError}
className='cardGameMain'
/>
</div>
<div className='cardGameMainTitle'>
<p>{title}</p>
</div>
</Link>
)
}