Last active
November 18, 2017 11:22
-
-
Save amite/625edacb714296378d7c4b8cf308eb2a to your computer and use it in GitHub Desktop.
Adding Tab Body
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<main className="App-content"> | |
<ul className="ItemPage-items"> | |
<li className="ItemPage-item"> | |
<div className="Item"> | |
<div className="Item-left"> | |
<img className="Item-image" /> | |
<div className="Item-title">Product Name</div> | |
<div className="Item-description">Description</div> | |
</div> | |
<div className="Item-right"> | |
<div className="Item-price">Price</div> | |
<button className="Item-addToCart">Add to Cart</button> | |
</div> | |
</div> | |
</li> | |
</ul> | |
<ul className="CartPage-items"> | |
<li className="CartPage-item"> | |
<div className="Item"> | |
<div className="Item-left"> | |
<img className="Item-image" src="" /> | |
<div className="Item-title">Product Name</div> | |
<div className="Item-description">Description</div> | |
</div> | |
<div className="Item-right"> | |
<div className="Item-price">Price</div> | |
<div className="CartItem-controls"> | |
<button className="CartItem-removeOne">–</button> | |
<span className="CartItem-count">Count</span> | |
<button className="CartItem-addOne">+</button> | |
</div> | |
</div> | |
</div> | |
</li> | |
</ul> | |
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function CartPage({ items }) { | |
return items ? ( | |
<ul className="CartPage-items"> | |
{items.map(item => ( | |
<li key={item.id} className="CartPage-item"> | |
<Item item={item}> | |
<div className="CartItem-controls"> | |
<button className="CartItem-removeOne">–</button> | |
<span className="CartItem-count">{item.count}</span> | |
<button className="CartItem-addOne">+</button> | |
</div> | |
</Item> | |
</li> | |
))} | |
</ul> | |
) : ( | |
<p>Your shopping cart is empty</p> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment