diff --git a/src/App.js b/src/App.js
index 213720b..f373424 100644
--- a/src/App.js
+++ b/src/App.js
@@ -3,6 +3,7 @@ import React, { useState } from "react";
import Header from "./components/Layout/Header";
import Meals from "./components/Meals/Meals";
import Cart from "./components/Cart/Cart";
+import CartProvider from "./store/CartProvider";
const App = () => {
const [cartIsShown, setCartIsShown] = useState(false);
@@ -16,7 +17,7 @@ const App = () => {
};
return (
- <>
+
{cartIsShown && (
)}
@@ -24,7 +25,7 @@ const App = () => {
- >
+
);
};
diff --git a/src/store/CartProvider.js b/src/store/CartProvider.js
new file mode 100644
index 0000000..09af01b
--- /dev/null
+++ b/src/store/CartProvider.js
@@ -0,0 +1,21 @@
+import CartContext from "./cart-context";
+
+const CartProvider = (props) => {
+ const addItemToCartHandler = (item) => {};
+ const removeItemFromCartHandler = (id) => {};
+
+ const cartContext = {
+ items: [],
+ totalAmount: 0,
+ addItem: addItemToCartHandler,
+ removeItem: removeItemFromCartHandler,
+ };
+
+ return (
+
+ {props.children}
+
+ );
+};
+
+export default CartProvider;
diff --git a/src/store/cart-context.js b/src/store/cart-context.js
new file mode 100644
index 0000000..56b42b3
--- /dev/null
+++ b/src/store/cart-context.js
@@ -0,0 +1,10 @@
+import React from "react";
+
+const CartContext = React.createContext({
+ items: [],
+ totalAmount: 0,
+ addItem: (item) => {},
+ removeItem: (id) => {},
+});
+
+export default CartContext;