From a1dd002d284fd5fc0ab24cde3b7bd037a119a408 Mon Sep 17 00:00:00 2001 From: daniyal Date: Wed, 18 Sep 2024 21:43:36 +0500 Subject: [PATCH] feat: enabled routing on game card --- src/components/GameCard.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/GameCard.tsx b/src/components/GameCard.tsx index ade5f15..1b34432 100644 --- a/src/components/GameCard.tsx +++ b/src/components/GameCard.tsx @@ -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 ( - +
navigate(getGamePageRoute(title))} + >
{

{title}

-
+
) }