Skip to content
2 changes: 0 additions & 2 deletions frontend/src/components/Nav.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { IoMdHome } from 'react-icons/io';

import { HiOutlineCollection } from 'react-icons/hi';

import { RiContactsLine } from 'react-icons/ri';
import { HiOutlineCollection } from 'react-icons/hi';
import { RiContactsLine } from 'react-icons/ri';
import { BsSearch, BsSun, BsMoon, BsBoxSeam } from 'react-icons/bs';
import { FaUserCircle, FaHeart } from 'react-icons/fa';
Expand Down
20 changes: 1 addition & 19 deletions frontend/src/context/ShopContext.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
const currency = '₹';
const delivery_fee = 40;
//wishlist functions
const fetchWishlist = async () => {
try {
const response = await apiConfig.get('/wishlist');
//wishlist functions
const fetchWishlist = async () => {
setLoadingWishlist(true);
setWishlistError(null);
Expand All @@ -41,24 +37,13 @@
setWishlistError(response.data.message || 'Failed to fetch wishlist');
}
} catch (error) {
console.log(error);

Check warning on line 40 in frontend/src/context/ShopContext.jsx

View workflow job for this annotation

GitHub Actions / Lint Frontend

Unexpected console statement

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected console statement

setWishlistError(error.response?.data?.message || error.message || 'Failed to fetch wishlist');
} finally {
setLoadingWishlist(false);
}
};
const addToWishlist = async (productId) => {
try {
const response = await apiConfig.post('/wishlist/add', { productId });

if (response.data.success) {
setWishlist(response.data.wishlist);
}
} catch (error) {
// eslint-disable-next-line no-console
console.error(error);
}
};
const addToWishlist = async (productId) => {
try {
const response = await apiConfig.post('/wishlist/add', { productId });
Expand Down Expand Up @@ -108,7 +93,7 @@
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error fetching products:', error);
console.log('Error fetching products:', error);

Check warning on line 96 in frontend/src/context/ShopContext.jsx

View workflow job for this annotation

GitHub Actions / Lint Frontend

Unexpected console statement

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected console statement
Continuous Integration / Lint Frontend

setProductsError(error.response?.data?.message || error.message || 'Failed to load products.');
} finally {
setLoadingProducts(false);
Expand Down Expand Up @@ -156,7 +141,7 @@
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error fetching cart:', error);
console.log('❌ Error fetching cart:', error);

Check warning on line 144 in frontend/src/context/ShopContext.jsx

View workflow job for this annotation

GitHub Actions / Lint Frontend

Unexpected console statement

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected console statement
Continuous Integration / Lint Frontend

setCartError(error.response?.data?.message || error.message || 'Failed to load cart.');
} finally {
setLoadingCart(false);
Expand Down Expand Up @@ -252,7 +237,7 @@

useEffect(() => {
getProducts();
}, []);

Check warning on line 240 in frontend/src/context/ShopContext.jsx

View workflow job for this annotation

GitHub Actions / Lint Frontend

React Hook useEffect has a missing dependency: 'getProducts'. Either include it or remove the dependency array

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected console statement
Continuous Integration / Lint Frontend

useEffect(() => {
if (userData) {
getUserCart();
Expand Down Expand Up @@ -289,13 +274,10 @@
removeFromCompare,
comparePanelOpen,
toggleComparePanel,
wishlist,
wishlist, loadingWishlist, wishlistError,
addToWishlist,
fetchWishlist,
removeFromWishlist,
setCartItem, UpdateQuantity, getCartAmount,
compareList, toggleCompare, removeFromCompare, comparePanelOpen, toggleComparePanel,
wishlist, loadingWishlist, wishlistError, addToWishlist, fetchWishlist, removeFromWishlist
};

return (
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/pages/BestSellers.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { useContext, useEffect, useState, useRef } from 'react';
import { motion } from 'framer-motion';
import gsap from 'gsap';
import { shopDataContext } from '../context/ShopContext';
import Card from '../components/Card';
import Title from '../components/Title';
import { motion } from 'framer-motion';
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';

gsap.registerPlugin(ScrollTrigger);

const BestSellers = () => {
const { product, compareList, toggleCompare } = useContext(shopDataContext);
Expand Down
7 changes: 2 additions & 5 deletions frontend/src/pages/NewArrivals.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import { useContext, useEffect, useState, useRef } from 'react';
import { motion } from 'framer-motion';
import gsap from 'gsap';
import { shopDataContext } from '../context/ShopContext';
import Card from '../components/Card';
import Title from '../components/Title';
import { motion } from 'framer-motion';
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';

gsap.registerPlugin(ScrollTrigger);

const NewArrivals = () => {
const {
Expand Down
13 changes: 2 additions & 11 deletions frontend/src/pages/Order.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,14 @@
import { shopDataContext } from '../context/ShopContext';
import apiConfig from '../utils/apiConfig';
import {
FaBox,
FaShoppingBag,
FaShippingFast,
FaCheckCircle,
FaClock,
FaMapMarkerAlt,
FaUndo,
FaBox, FaShoppingBag, FaShippingFast, FaCheckCircle,
FaClock, FaMapMarkerAlt, FaUndo, FaCalendarAlt, FaMoneyBillWave, FaStar,
} from 'react-icons/fa';
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
import { FaCalendarAlt, FaMoneyBillWave, FaStar } from 'react-icons/fa';
import { FaBox, FaShoppingBag, FaShippingFast, FaCheckCircle, FaClock, FaMapMarkerAlt, FaUndo, FaCalendarAlt, FaMoneyBillWave, FaStar } from 'react-icons/fa';
import { GiReceiveMoney } from 'react-icons/gi';
import Title from '../components/Title';
import { LoadingState, EmptyState, ErrorState } from '../components/StateComponents';
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';

gsap.registerPlugin(ScrollTrigger);

Expand Down Expand Up @@ -55,7 +46,7 @@
} catch (error) {
// eslint-disable-next-line no-console
console.error('Error loading orders:', error);
console.log('Error loading orders:', error);

Check warning on line 49 in frontend/src/pages/Order.jsx

View workflow job for this annotation

GitHub Actions / Lint Frontend

Unexpected console statement
setError(error.response?.data?.message || error.message || 'Failed to load orders.');
} finally {
setIsLoading(false);
Expand Down
10 changes: 2 additions & 8 deletions frontend/src/pages/wishlist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ import { LoadingState, EmptyState, ErrorState } from '../components/StateCompone
import { FaHeart, FaTrash } from 'react-icons/fa';

function Wishlist() {
const { wishlist, fetchWishlist, currency, removeFromWishlist } =
useContext(shopDataContext);
const {
wishlist,
fetchWishlist,
currency,
removeFromWishlist,
loadingWishlist,
wishlistError,
wishlist, fetchWishlist, currency, removeFromWishlist,
loadingWishlist, wishlistError,
} = useContext(shopDataContext);

const navigate = useNavigate();
Expand Down
Loading