Skip to content

Commit

Permalink
Merge branch 'main' into ADD-image-hover-mb
Browse files Browse the repository at this point in the history
  • Loading branch information
toddalbert authored Oct 31, 2023
2 parents 12a5210 + a017295 commit 3e70a58
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"workbench.colorCustomizations": {
"activityBar.background": "#2C2560",
"titleBar.activeBackground": "#3E3386",
"titleBar.activeForeground": "#FBFBFD"
}
}
14 changes: 12 additions & 2 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
background-color: #402010;
background-color: #402090;
color: antiquewhite;
padding: 2em;
}
Expand Down Expand Up @@ -30,6 +30,11 @@ main {
border-radius: 8px;
margin: 0.5em;
width: 260px;
cursor: pointer;
}

.selected {
border: 1px solid #ff00d0;
}

.beer-card:hover{
Expand All @@ -39,7 +44,7 @@ main {
.beer-image {
width: 100%;
max-height: 500px;

transition: 0.3s;
}

.beer-image:hover{
Expand Down Expand Up @@ -69,6 +74,7 @@ main {
max-width: 90%;
}


.beer-card h2 {
font-size: medium;
margin-bottom: 4px;
Expand Down Expand Up @@ -96,3 +102,7 @@ main {
position: absolute;
overflow: hidden;
}

.beer-card:hover, .beer-card:active {
background-color: greenyellow;
}
5 changes: 2 additions & 3 deletions src/components/BeerCard.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +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 (
<div className="beer-card" onClick={() => setSelectedBeer(name)}>

<div className={`beer-card ${isSelected && 'selected'}`} onClick={() => setSelectedBeer(name)}>
<div className="close-button" onClick={() => setHidden(true)}>x</div>
<div className="beer-image">
<img src={image} alt={name}
Expand Down
1 change: 1 addition & 0 deletions src/components/BeerList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default function BeerList() {
image={beer.image}
avgRating={beer.rating.average}
setSelectedBeer={setSelectedBeer}
isSelected={selectedBeer === beer.name}
/>
))
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export default function Header() {
return <h1>The Beers! (hey that's a bad joke) 🍻</h1>
return <h1>🍻 IPA's 🍻</h1>
}

0 comments on commit 3e70a58

Please sign in to comment.