diff --git a/src/App.css b/src/App.css index f526e98..6878609 100644 --- a/src/App.css +++ b/src/App.css @@ -32,6 +32,10 @@ main { width: 260px; } +.selected { + border: 1px solid #00ff48; +} + .beer-image { width: 100%; max-height: 500px; diff --git a/src/components/BeerCard.jsx b/src/components/BeerCard.jsx index 261f458..9b4286b 100644 --- a/src/components/BeerCard.jsx +++ b/src/components/BeerCard.jsx @@ -1,10 +1,10 @@ import { useState } from "react"; -export default function BeerCard({ name, image, avgRating, setSelectedBeer }) { +export default function BeerCard({ name, image, avgRating, setSelectedBeer, isSelected }) { const [hidden, setHidden] = useState(false) if(hidden) return null return ( -
setSelectedBeer(name)}> +
setSelectedBeer(name)}>
setHidden(true)}>x
{name}

{name}

-

XXXXX

-

XXXXX

+

⭐️⭐️⭐️⭐️⭐️

+

⭐️⭐️⭐️⭐️⭐️

) diff --git a/src/components/BeerList.jsx b/src/components/BeerList.jsx index 7c47138..f79fbfc 100644 --- a/src/components/BeerList.jsx +++ b/src/components/BeerList.jsx @@ -40,6 +40,7 @@ export default function BeerList() { image={beer.image} avgRating={beer.rating.average} setSelectedBeer={setSelectedBeer} + isSelected={selectedBeer === beer.name} /> )) )}