Skip to content

Instantly share code, notes, and snippets.

@john-raymon
Created June 3, 2019 06:19
Show Gist options
  • Save john-raymon/d71b3df019faefc15460cc7fd8b10350 to your computer and use it in GitHub Desktop.
Save john-raymon/d71b3df019faefc15460cc7fd8b10350 to your computer and use it in GitHub Desktop.
LineItem Component
import React from 'react'
function LineItem({ id, name, quantity, removeProductFromCart }) {
return (
<div className="cart-container__line-item w-100 flex items-center justify-between pb2">
<div className="w-auto pr1">
<p className="tracked ttc f7">
{name} - ({quantity})
</p>
</div>
<button className="dim b1 b--mid-gray outline-0 pointer pa2" onClick={() => removeProductFromCart(id)}>
Remove from Cart
</button>
</div>
)
}
export default LineItem;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment