diff --git a/src/Components/Cart.jsx b/src/Components/Cart.jsx index 917b7a1..63b864d 100644 --- a/src/Components/Cart.jsx +++ b/src/Components/Cart.jsx @@ -1,5 +1,5 @@ import { Dialog, Transition } from "@headlessui/react"; -import { XIcon } from "@heroicons/react/outline"; +import { XIcon, ShoppingCartIcon } from "@heroicons/react/outline"; import React, { Fragment } from "react"; export default function Cart({ open, setOpen, cart, updateCart }) { @@ -37,7 +37,7 @@ export default function Cart({ open, setOpen, cart, updateCart }) { >
-
+
Shopping cart
@@ -51,7 +51,11 @@ export default function Cart({ open, setOpen, cart, updateCart }) {
- + {cart.length == 0 && +
+ + Your Cart is Empty. +
}
    @@ -105,7 +109,7 @@ export default function Cart({ open, setOpen, cart, updateCart }) {

    Subtotal

    -

    $262.00

    +

    ${cart.reduce(function (acc, obj) { return acc + (obj.price * obj.quantity)}, 0)}

    Shipping and taxes calculated at checkout.

    diff --git a/src/Components/ProductTable.jsx b/src/Components/ProductTable.jsx index ea76621..4bcff02 100644 --- a/src/Components/ProductTable.jsx +++ b/src/Components/ProductTable.jsx @@ -41,7 +41,7 @@ export default function ProductTable({ cart, updateCart }) { setProducts(body); }; fetchProducts(); - }); + }, []); return (