Skip to content

Commit

Permalink
setting classes and text conditionally.
Browse files Browse the repository at this point in the history
  • Loading branch information
eatornquist committed Sep 8, 2023
1 parent 26a9f13 commit a602341
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Fast React Pizza Co.</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ function Menu() {
//Pizza component receiving props from Menu component
function Pizza({ pizzaObj }) {
return (
<li className="pizza">
<li className={`pizza ${pizzaObj.soldOut ? 'sold-out' : ''}`}>
<img src={pizzaObj.photoName} alt={pizzaObj.name} />
<div>
<h3>{pizzaObj.name}</h3>
<p>{pizzaObj.ingredients}</p>
<span>{pizzaObj.price}</span>
<span>{pizzaObj.soldOut ? 'SOLD OUT' : pizzaObj.price}</span>
</div>
</li>
)
Expand Down

0 comments on commit a602341

Please sign in to comment.