From 9f5c52dbf2a02dc2c7fd6dc689b0960c238eb807 Mon Sep 17 00:00:00 2001 From: Hemanth kumar Date: Wed, 15 May 2024 21:41:52 +0530 Subject: [PATCH] Main page groceries, electronics, fashion buttons Not Working Fixed (#137) * New branch * Issue fixed --- src/App.js | 7 ------- src/components/header/header.js | 2 +- src/components/header/nav/nav.js | 7 +++---- src/pages/Details/index.js | 4 ++-- src/pages/wishList/index.js | 3 +-- 5 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/App.js b/src/App.js index c757514..b7bbd69 100644 --- a/src/App.js +++ b/src/App.js @@ -74,17 +74,14 @@ function App() { }; const fetchWishlistProducts = async () => { - console.log("fetchWishlistProducts"); try { const wishlistRef = doc(db, "wishlists", localStorage.getItem("uid")); const productsCollectionRef = collection(wishlistRef, "products"); const querySnapshot = await getDocs(productsCollectionRef); - console.log(querySnapshot); const products = []; querySnapshot.forEach((doc) => { products.push({ id: doc.id, ...doc.data() }); }); - console.log(products); setWishlistItems(products); setWishlistCount(products.length); // Set the product count } catch (error) { @@ -102,7 +99,6 @@ function App() { throw new Error("Network response was not ok"); } const data = await response.json(); - // //console.log("fetced data", data) setData(data); } catch (error) { console.error("Error fetching data:", error); @@ -138,7 +134,6 @@ function App() { (snapshot) => { const data = snapshot.val(); setCartItems(data); - //console.log("Data fetched successfully:", data); }, (error) => { console.error("Error fetching data:", error); @@ -163,7 +158,6 @@ function App() { (snapshot) => { const data = snapshot.val(); setCartItems(data); - //console.log("Data fetched successfully:", data); }, (error) => { console.error("Error fetching data:", error); @@ -184,7 +178,6 @@ function App() { const uniqueKey = user + item.id; // Modify as per your requirement // Add item to the cart in Firebase setCartItems([...cartItems, { ...item, quantity: 1 }]); - //console.log('Item added to cart successfully'); } catch (error) { console.error("Error adding item to cart:", error); } diff --git a/src/components/header/header.js b/src/components/header/header.js index 05e58de..9e4c59c 100644 --- a/src/components/header/header.js +++ b/src/components/header/header.js @@ -86,7 +86,7 @@ const Header = (props) => { } }); } catch (error) { - //console.log(error.message); + console.log(error); } }; diff --git a/src/components/header/nav/nav.js b/src/components/header/nav/nav.js index e0016db..14d9819 100644 --- a/src/components/header/nav/nav.js +++ b/src/components/header/nav/nav.js @@ -20,7 +20,6 @@ const Nav = (props) => { const [openDropdownMenuIndex, setDropdownMenuIndex] = useState(null); const [openMegaMenu, setOpenMegaMenu] = useState(false); - const context = useContext(MyContext); useEffect(() => { @@ -67,7 +66,7 @@ const Nav = (props) => { navData.map((item, index) => { return (
  • - { @@ -79,8 +78,8 @@ const Nav = (props) => { item.items.map((item_, index_) => { return (
  • -