You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
568 B
JavaScript

import React from 'react'
import { Link } from 'react-router-dom'
const PokemonList = ({ pokemonList }) => {
return (
<div className="list-container">
{pokemonList.map(({ id, name }) => (
<Link key={id} to={`/pokemon/${name}`} className="list-item" style={{ backgroundImage: `url(${`https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${id}.png`})` }}>
<div
className="list-item-name"
>
{name}
</div>
</Link>
))}
</div>
)
}
export default PokemonList