Refactored PokemonCard a little bit
This commit is contained in:
parent
1f0ab75d6e
commit
2ae23cdbfa
@ -17,12 +17,7 @@ export function formatNumber(num: number) {
|
|||||||
return '#' + num.toString().padStart(3, '0');
|
return '#' + num.toString().padStart(3, '0');
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function PokemonCard({
|
const PokemonCard = ({ id, name, image, types }: PokemonCardProps) => {
|
||||||
id,
|
|
||||||
name,
|
|
||||||
image,
|
|
||||||
types,
|
|
||||||
}: PokemonCardProps) {
|
|
||||||
let finalColor;
|
let finalColor;
|
||||||
|
|
||||||
if (types.length === 2) {
|
if (types.length === 2) {
|
||||||
@ -73,4 +68,6 @@ export default function PokemonCard({
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
|
export default PokemonCard;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user