Skip to content

Commit

Permalink
Merge branch 'main' into ADD-Card-Outline-mp
Browse files Browse the repository at this point in the history
  • Loading branch information
toddalbert authored Oct 31, 2023
2 parents 4fbeaf3 + a5105f5 commit 9b46be2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 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"
}
}
12 changes: 11 additions & 1 deletion 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 @@ -33,9 +33,18 @@ main {
/* background-color; */
}

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

.beer-image {
width: 100%;
max-height: 500px;
transition: 0.3s;
}

.beer-image:hover{
transform: scale(1.5);
}

.close-button {
Expand All @@ -61,6 +70,7 @@ main {
max-width: 90%;
}


.beer-card h2 {
font-size: medium;
margin-bottom: 4px;
Expand Down
4 changes: 2 additions & 2 deletions src/components/BeerCard.jsx
Original file line number Diff line number Diff line change
@@ -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 (
<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! (IPA) 🍻</h1>
return <h1>IPA's! 🍻</h1>
}

0 comments on commit 9b46be2

Please sign in to comment.