Move poke__type css class into PokemonCard component

develop
Jason Zhu 2023-05-07 15:50:47 +10:00
parent b56eae4e40
commit 5068a6f728
2 changed files with 6 additions and 4 deletions

View File

@ -54,8 +54,8 @@ export interface PokemonTypesProps {
const PokemonTypes = ({ types }: PokemonTypesProps) => {
return (
// TODO: fix static typed poke__type css
<div className="poke__type">
// css is set in consumer
<>
{types.map(type => (
<Tooltip title={type} key={type} TransitionComponent={Zoom} arrow>
<div className={`poke__type__bg ${type}`}>
@ -63,7 +63,7 @@ const PokemonTypes = ({ types }: PokemonTypesProps) => {
</div>
</Tooltip>
))}
</div>
</>
);
};

View File

@ -67,8 +67,10 @@ export default function PokemonCard({
</div>
<div className="poke__name">
<h3>{name}</h3>
<div className="poke__type">
<PokemonTypes types={types} />
</div>
</div>
</div>
);
}