Multi-file games lists, clicking a game leads to mod search for that game, search redirects, pagination optimizations #38
@ -1,5 +1,7 @@
|
|||||||
|
import { useNavigate } from 'react-router-dom'
|
||||||
import '../styles/cardGames.css'
|
import '../styles/cardGames.css'
|
||||||
import { handleGameImageError } from '../utils'
|
import { handleGameImageError } from '../utils'
|
||||||
|
import { getGamePageRoute } from 'routes'
|
||||||
|
|
||||||
type GameCardProps = {
|
type GameCardProps = {
|
||||||
title: string
|
title: string
|
||||||
@ -7,8 +9,13 @@ type GameCardProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const GameCard = ({ title, imageUrl }: GameCardProps) => {
|
export const GameCard = ({ title, imageUrl }: GameCardProps) => {
|
||||||
|
const navigate = useNavigate()
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<a className='cardGameMainWrapperLink' href='search.html'>
|
<div
|
||||||
|
className='cardGameMainWrapperLink'
|
||||||
|
onClick={() => navigate(getGamePageRoute(title))}
|
||||||
|
>
|
||||||
<div className='cardGameMainWrapper'>
|
<div className='cardGameMainWrapper'>
|
||||||
<img
|
<img
|
||||||
src={imageUrl}
|
src={imageUrl}
|
||||||
@ -19,6 +26,6 @@ export const GameCard = ({ title, imageUrl }: GameCardProps) => {
|
|||||||
<div className='cardGameMainTitle'>
|
<div className='cardGameMainTitle'>
|
||||||
<p>{title}</p>
|
<p>{title}</p>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user