From 06f0282cad471e8c893054fd3a0966a2704950a9 Mon Sep 17 00:00:00 2001 From: daniyal Date: Wed, 18 Sep 2024 08:17:07 +0500 Subject: [PATCH] chore: memoize modCard --- src/components/ModCard.tsx | 147 ++++++++++++++++++------------------- 1 file changed, 72 insertions(+), 75 deletions(-) diff --git a/src/components/ModCard.tsx b/src/components/ModCard.tsx index 0ceb5d5..ca653fb 100644 --- a/src/components/ModCard.tsx +++ b/src/components/ModCard.tsx @@ -1,3 +1,4 @@ +import React from 'react' import { Link } from 'react-router-dom' import '../styles/cardMod.css' import { handleModImageError } from '../utils' @@ -10,83 +11,79 @@ type ModCardProps = { route: string } -export const ModCard = ({ - title, - gameName, - summary, - imageUrl, - route -}: ModCardProps) => { - return ( - -
-
- -
-
-

{title}

-

{summary}

-
-

{gameName}

+export const ModCard = React.memo( + ({ title, gameName, summary, imageUrl, route }: ModCardProps) => { + return ( + +
+
+
-
-
-
-
- - - -

420

+
+

{title}

+

{summary}

+
+

{gameName}

-
- - - -

420

-
-
- - - -

420

-
-
- - - -

420

+
+
+
+
+ + + +

420

+
+
+ + + +

420

+
+
+ + + +

420

+
+
+ + + +

420

+
-
- - ) -} + + ) + } +)