diff --git a/ordering/src/components/Layout/HeaderCartButton.js b/ordering/src/components/Layout/HeaderCartButton.js
index 6724eae..0b41983 100644
--- a/ordering/src/components/Layout/HeaderCartButton.js
+++ b/ordering/src/components/Layout/HeaderCartButton.js
@@ -1,16 +1,23 @@
+import { useContext } from "react"
import CartIcon from "../Cart/CartIcon"
import classes from "./HeaderCartButton.module.css"
+import CartContext from "../../store/cart-context"
+
function HeaderCartButton(props) {
+ const cartCtx = useContext(CartContext)
+
+ const numberOfCartItems = cartCtx.items.reduce((curNumber, item) => {
+ return curNumber + item.amount
+ }, 0)
+
return (
-