Skip to content

Instantly share code, notes, and snippets.

@amite
Last active November 18, 2017 11:22
Show Gist options
  • Save amite/625edacb714296378d7c4b8cf308eb2a to your computer and use it in GitHub Desktop.
Save amite/625edacb714296378d7c4b8cf308eb2a to your computer and use it in GitHub Desktop.
Adding Tab Body
<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">&ndash;</button>
<span className="CartItem-count">Count</span>
<button className="CartItem-addOne">+</button>
</div>
</div>
</div>
</li>
</ul>
</main>
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">&ndash;</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