|
|
|
@ -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", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<div className="w-full lg:w-11/12 lg:mx-auto relative flex items-center justify-between py-3 px-4" style={{ |
|
|
|
|
backgroundColor: isDark ? "#061B30" : "white" |
|
|
|
|
}}> |
|
|
|
|
<div |
|
|
|
|
className="w-full lg:w-11/12 lg:mx-auto relative flex items-center justify-between py-3 px-4" |
|
|
|
|
style={{ |
|
|
|
|
backgroundColor: isDark ? "#061B30" : "white", |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
{/* desktop */} |
|
|
|
|
<div className=" items-center hidden lg:flex"> |
|
|
|
|
<Link |
|
|
|
@ -189,7 +190,7 @@ function Navbar({ |
|
|
|
|
<img |
|
|
|
|
src={isDark ? qrIcon : qrBlueIcon} |
|
|
|
|
alt="" |
|
|
|
|
className={_.join(["w-6"], " ")} |
|
|
|
|
className="w-6" |
|
|
|
|
/> |
|
|
|
|
</Link> |
|
|
|
|
<Link |
|
|
|
@ -204,7 +205,7 @@ function Navbar({ |
|
|
|
|
<img |
|
|
|
|
src={isDark ? arIcon : arBlueIcon} |
|
|
|
|
alt="" |
|
|
|
|
className={_.join(["w-6"], " ")} |
|
|
|
|
className="w-6" |
|
|
|
|
/> |
|
|
|
|
</Link> |
|
|
|
|
</> |
|
|
|
@ -214,9 +215,7 @@ function Navbar({ |
|
|
|
|
<Loading size={2} color="bg-green-500" /> |
|
|
|
|
) : isActiveBookmark ? ( |
|
|
|
|
<img |
|
|
|
|
src={ |
|
|
|
|
isDark ? bookmarkActiveDarkIcon : bookmarkActiveLightIcon |
|
|
|
|
} |
|
|
|
|
src={isDark ? bookmarkActiveDarkIcon : bookmarkActiveLightIcon} |
|
|
|
|
alt="bookmark" |
|
|
|
|
className="w-7 flex lg:hidden" |
|
|
|
|
onClick={() => |
|
|
|
@ -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); |
|
|
|
|