diff --git a/ordering/src/components/Cart/Cart.js b/ordering/src/components/Cart/Cart.js index 6eab667..d4f17d2 100644 --- a/ordering/src/components/Cart/Cart.js +++ b/ordering/src/components/Cart/Cart.js @@ -1,15 +1,33 @@ -import React from "react" +import React, { useContext } from "react" import classes from "./Cart.module.css" +import CartItem from "./CartItem" + import Modal from "../UI/Modal" +import CartContext from "../../store/cart-context" function Cart(props) { + const cartCtx = useContext(CartContext) + + const totalAmount = `$${cartCtx.totalAmount.toFixed(2)}` + const hasItems = cartCtx.items.length > 0 + + const cartItemRemoveHandler = id => {} + const cartItemAddHandler = items => {} + const cartItems = (