diff --git a/src/components/Dots/index.js b/src/components/Dots/index.js index 57dc57a..f965861 100644 --- a/src/components/Dots/index.js +++ b/src/components/Dots/index.js @@ -1,15 +1,11 @@ import React, { useState, useEffect } from "react"; -import _ from "lodash"; export default function Dots() { const [scroll, setScroll] = useState(null); const [active, setActive] = useState(null); const height = window.innerHeight; useEffect(() => { - window.addEventListener( - "scroll", - _.debounce(() => setScroll(window.scrollY), 20) - ); + window.addEventListener(setScroll(window.scrollY), 20); }, []); useEffect(() => { @@ -67,21 +63,17 @@ const Dot = ({ value, active, index, setActive }) => { }; return (
click()} >
); diff --git a/src/components/Input/index.js b/src/components/Input/index.js index b25482e..b0af933 100644 --- a/src/components/Input/index.js +++ b/src/components/Input/index.js @@ -1,5 +1,4 @@ import React, { useState } from "react"; -import _ from "lodash"; export default function Input(props) { const [focusToggle, setFocusToggle] = useState(false); diff --git a/src/components/MainFooter/index.js b/src/components/MainFooter/index.js index dee1fce..a4a4849 100644 --- a/src/components/MainFooter/index.js +++ b/src/components/MainFooter/index.js @@ -1,6 +1,5 @@ import React from "react"; import { Link } from "react-router-dom"; -import _ from "lodash"; import enamadlogo from "./enamad-pic.svg"; import callIcon from "../../assets/icons/vuesax-linear-call-calling.svg"; diff --git a/src/components/Navbar/index.js b/src/components/Navbar/index.js index ce3a724..b775fb6 100644 --- a/src/components/Navbar/index.js +++ b/src/components/Navbar/index.js @@ -3,7 +3,6 @@ import { Link, useNavigate, NavLink } from "react-router-dom"; import { connect } from "react-redux"; import { userProduct, userFavorite } from "../../redux/actions"; import location from "../../utils/location"; -import _ from "lodash"; //components import Drawer from "../Drawer"; @@ -79,7 +78,6 @@ function Navbar({ useEffect(() => { if (!isMobile && user) { - getCartProducts(); } }, [user]); @@ -91,9 +89,12 @@ function Navbar({ backgroundColor: !top ? (isDark ? "#061B30" : "white") : "white", }} > -
+
{/* desktop */}
@@ -214,9 +215,7 @@ function Navbar({ ) : isActiveBookmark ? ( bookmark @@ -331,7 +330,7 @@ const mapDispatchToProps = { getCartProducts: userProduct.list, addToFavorite: userFavorite.add, deleteBookmark: userFavorite.del, - getUserFavorite: userFavorite.list + getUserFavorite: userFavorite.list, }; export default connect(mapStateToProps, mapDispatchToProps)(Navbar); diff --git a/src/components/Search/index.js b/src/components/Search/index.js index 255e2c1..8b2e416 100644 --- a/src/components/Search/index.js +++ b/src/components/Search/index.js @@ -1,7 +1,6 @@ import React from "react"; import { connect } from "react-redux"; import { publicApi } from "../../redux/actions"; -import _ from "lodash"; //assets import searchIcon from "./search.png"; @@ -15,13 +14,9 @@ function Search(props) {