Multi-file games lists, clicking a game leads to mod search for that game, search redirects, pagination optimizations #38

Merged
freakoverse merged 11 commits from staging into master 2024-09-18 19:30:26 +00:00
Showing only changes of commit a1dd002d28 - Show all commits

View File

@ -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>
) )
} }