diff --git a/src/components/common/ScrollToTop.js b/src/components/common/ScrollToTop.js index e6df35c..56c6f4a 100644 --- a/src/components/common/ScrollToTop.js +++ b/src/components/common/ScrollToTop.js @@ -4,7 +4,10 @@ import { withRouter } from "react-router-dom"; function ScrollToTop({ history }) { useEffect(() => { const unlisten = history.listen(() => { - window.scrollTo(0, 0); + window.scrollTo({ + top: 0, + behavior: 'smooth' + }); }); return () => { unlisten(); diff --git a/src/components/frontend/PublicRoutes.js b/src/components/frontend/PublicRoutes.js index a83b3cd..8425333 100644 --- a/src/components/frontend/PublicRoutes.js +++ b/src/components/frontend/PublicRoutes.js @@ -21,6 +21,7 @@ import TC from "./home/TC"; import AboutUs from "./home/AboutUs"; import Shipping from "./home/Shipping"; import RC from "./home/RC"; +import Wishlist from "./wishlist/Wishlist"; class PublicRoutes extends Component { render() { @@ -35,6 +36,7 @@ class PublicRoutes extends Component { + - My Cart + {/* My Cart */} + + {/* my change in for adding wishlist */} + + + + + {/* */} + + {/* */} + + + {/* My wislist */} + + + + + + diff --git a/src/components/frontend/cart/Cart.js b/src/components/frontend/cart/Cart.js index 9d738ca..7ba3e16 100644 --- a/src/components/frontend/cart/Cart.js +++ b/src/components/frontend/cart/Cart.js @@ -82,7 +82,7 @@ function Cart(props) { - {props.cart.length > 0 && ( + {props.cart.length > 0 ? <> My Cart({props.cart.length}) @@ -94,36 +94,35 @@ function Cart(props) { ))} > - )} - {props.cart.length === 0 && ( + : <> - - - - No Items in Cart - - - Explore the wide range of our products and have them - delivered to your doorstep - - - Explore Our Products - - + + + + oops cart is empty + + + Explore the wide range of our products and have them + delivered to your doorstep + + + Explore Our Products + - > - )} + + > + } diff --git a/src/components/frontend/product/ProductCard.js b/src/components/frontend/product/ProductCard.js index 8f16785..c14028d 100644 --- a/src/components/frontend/product/ProductCard.js +++ b/src/components/frontend/product/ProductCard.js @@ -13,6 +13,7 @@ import { import Skeleton from "@material-ui/lab/Skeleton"; import { configs } from "../../../config/configs"; import { titleToId } from "../../common/utils"; +import FavoriteBorderIcon from '@mui/icons-material/FavoriteBorder'; const useStyles = makeStyles((theme) => ({ root: { @@ -255,8 +256,9 @@ function ProductCard(props) { {count < 1 && productData.visibility && ( - Add to My Cart + Add to Cart + )} {!productData.visibility && ( diff --git a/src/components/frontend/wishlist/Wishlist.js b/src/components/frontend/wishlist/Wishlist.js new file mode 100644 index 0000000..ff85850 --- /dev/null +++ b/src/components/frontend/wishlist/Wishlist.js @@ -0,0 +1,11 @@ +import React from 'react' + +const Wishlist = () => { + return ( + + your wishlist + + ) +} + +export default Wishlist
My Cart
My wislist