feat: enabled routing on game card
All checks were successful
Release to Staging / build_and_release (push) Successful in 46s
All checks were successful
Release to Staging / build_and_release (push) Successful in 46s
This commit is contained in:
parent
72cbd325b0
commit
a1dd002d28
@ -1,5 +1,7 @@
|
||||
import { useNavigate } from 'react-router-dom'
|
||||
import '../styles/cardGames.css'
|
||||
import { handleGameImageError } from '../utils'
|
||||
import { getGamePageRoute } from 'routes'
|
||||
|
||||
type GameCardProps = {
|
||||
title: string
|
||||
@ -7,8 +9,13 @@ type GameCardProps = {
|
||||
}
|
||||
|
||||
export const GameCard = ({ title, imageUrl }: GameCardProps) => {
|
||||
const navigate = useNavigate()
|
||||
|
||||
return (
|
||||
<a className='cardGameMainWrapperLink' href='search.html'>
|
||||
<div
|
||||
className='cardGameMainWrapperLink'
|
||||
onClick={() => navigate(getGamePageRoute(title))}
|
||||
>
|
||||
<div className='cardGameMainWrapper'>
|
||||
<img
|
||||
src={imageUrl}
|
||||
@ -19,6 +26,6 @@ export const GameCard = ({ title, imageUrl }: GameCardProps) => {
|
||||
<div className='cardGameMainTitle'>
|
||||
<p>{title}</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user