chore: memoize modCard

This commit is contained in:
daniyal 2024-09-18 08:17:07 +05:00
parent 5b641ff4cc
commit 06f0282cad

View File

@ -1,3 +1,4 @@
import React from 'react'
import { Link } from 'react-router-dom'
import '../styles/cardMod.css'
import { handleModImageError } from '../utils'
@ -10,13 +11,8 @@ type ModCardProps = {
route: string
}
export const ModCard = ({
title,
gameName,
summary,
imageUrl,
route
}: ModCardProps) => {
export const ModCard = React.memo(
({ title, gameName, summary, imageUrl, route }: ModCardProps) => {
return (
<Link className='cardModMainWrapperLink' to={route}>
<div className='cardModMain'>
@ -89,4 +85,5 @@ export const ModCard = ({
</div>
</Link>
)
}
}
)