|
|
@ -70,24 +70,52 @@ function Navbar({ |
|
|
|
} |
|
|
|
} |
|
|
|
}, [isLogin]); |
|
|
|
}, [isLogin]); |
|
|
|
|
|
|
|
|
|
|
|
return isMobile ? ( |
|
|
|
return ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
className={_.join( |
|
|
|
className="z-50 flex fixed left-0 top-0 w-full" |
|
|
|
[ |
|
|
|
|
|
|
|
"z-50 flex flex-1 flex-row fixed left-0 top-0 justify-between w-full lg:bg-opacity-20 lg:bg-transparent lg:shadow-sm lg:backdrop-filter lg:backdrop-blur-md lg:px-5 xl:px-10 transition-all duration-300", |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
" " |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
backgroundColor: !top ? (isDark ? "#061B30" : "white") : "", |
|
|
|
backgroundColor: !top ? (isDark ? "#061B30" : "white") : "", |
|
|
|
}} |
|
|
|
}} |
|
|
|
> |
|
|
|
> |
|
|
|
{/* landscape start */} |
|
|
|
<div className="w-full lg:w-11/12 lg:mx-auto relative flex items-center justify-between py-3 px-4 bg-white"> |
|
|
|
{/* landscape end */} |
|
|
|
{/* desktop */} |
|
|
|
{/* portrait start */} |
|
|
|
<div className=" items-center hidden lg:flex"> |
|
|
|
|
|
|
|
<Link |
|
|
|
|
|
|
|
to="/" |
|
|
|
|
|
|
|
className="flex items-center text-2xl font-black text-green7B" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<img src={logoIcon} className="w-8 relative bottom-1 ml-1" alt="" /> |
|
|
|
|
|
|
|
{window.t("دانوین")} |
|
|
|
|
|
|
|
</Link> |
|
|
|
|
|
|
|
|
|
|
|
<div className="w-full h-full relative flex flex-row items-center justify-between lg:hidden py-3 px-4"> |
|
|
|
<ul className="flex list-none items-center relative top-0.5 mr-4"> |
|
|
|
<div className="relative"> |
|
|
|
{pages.map((page, index) => ( |
|
|
|
|
|
|
|
<li key={index}> |
|
|
|
|
|
|
|
<NavLink |
|
|
|
|
|
|
|
to={page.link} |
|
|
|
|
|
|
|
className="text-tiny py-2 px-4 mx-4" |
|
|
|
|
|
|
|
style={({ isActive }) => ({ |
|
|
|
|
|
|
|
color: isActive ? "rgb(19, 123, 79)" : "#202020", |
|
|
|
|
|
|
|
fontWeight: isActive ? "700" : "200", |
|
|
|
|
|
|
|
})} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{page.name} |
|
|
|
|
|
|
|
</NavLink> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
{logo && ( |
|
|
|
|
|
|
|
<Link |
|
|
|
|
|
|
|
to="/" |
|
|
|
|
|
|
|
className="lg:hidden absolute left-1/2 transform -translate-y-1/2 top-1/2 -translate-x-1/2" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<img src={logoIcon} className="w-6 h-8" /> |
|
|
|
|
|
|
|
</Link> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
{/* desktop */} |
|
|
|
|
|
|
|
{/* <div className="flex items-center"></div> */} |
|
|
|
|
|
|
|
<div className="flex lg:hidden relative"> |
|
|
|
{hamburgerMenu && ( |
|
|
|
{hamburgerMenu && ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<span className="w-2.5 h-2.5 rounded-full bg-redFF1 absolute -left-1 -top-1 animate-bounce"></span> |
|
|
|
<span className="w-2.5 h-2.5 rounded-full bg-redFF1 absolute -left-1 -top-1 animate-bounce"></span> |
|
|
@ -113,29 +141,31 @@ function Navbar({ |
|
|
|
</strong> |
|
|
|
</strong> |
|
|
|
)} |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{logo && ( |
|
|
|
<div className="flex items-center"> |
|
|
|
<Link |
|
|
|
{overLayer && ( |
|
|
|
to="/" |
|
|
|
<div |
|
|
|
className="absolute left-1/2 transform -translate-y-1/2 top-1/2 -translate-x-1/2" |
|
|
|
className="z-30 w-screen h-full fixed top-0 right-0 backdrop-filter blur-sm bg-opacity-60 bg-gray-600" |
|
|
|
|
|
|
|
onClick={() => setOverLayer(false)} |
|
|
|
> |
|
|
|
> |
|
|
|
<img src={logoIcon} className="w-6 h-8" /> |
|
|
|
<div className="relative w-full h-full"> |
|
|
|
</Link> |
|
|
|
<div |
|
|
|
|
|
|
|
className="flex flex-col w-full absolute left-1/2 top-16 transform -translate-x-1/2 z-50 rounded-md" |
|
|
|
|
|
|
|
style={{ maxWidth: "calc(100vw / 3)" }} |
|
|
|
|
|
|
|
onClick={(e) => e.stopPropagation()} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Search onChange={(val) => setSearch(val)} /> |
|
|
|
|
|
|
|
{search && <SearchResult text={search} setText={setSearch} />} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
<div className="flex flex-row items-center"> |
|
|
|
|
|
|
|
{qr && ( |
|
|
|
{qr && ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
<Link |
|
|
|
<Link |
|
|
|
to="/scan" |
|
|
|
to="/scan" |
|
|
|
className={_.join( |
|
|
|
className={`flex lg:hidden rounded-sm p-1.5 ${ |
|
|
|
[ |
|
|
|
isDark ? "bg-blueC0 bg-opacity-10 ml-2" : " ml-3 shadow-sm" |
|
|
|
"rounded-sm p-1.5", |
|
|
|
}`}
|
|
|
|
isDark |
|
|
|
|
|
|
|
? "bg-blueC0 bg-opacity-10 ml-2" |
|
|
|
|
|
|
|
: " ml-3 shadow-sm", |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
" " |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
border: `1px solid ${isDark ? "#D7E3FC20" : "#D7E3FC"}`, |
|
|
|
border: `1px solid ${isDark ? "#D7E3FC20" : "#D7E3FC"}`, |
|
|
|
}} |
|
|
|
}} |
|
|
@ -148,13 +178,9 @@ function Navbar({ |
|
|
|
</Link> |
|
|
|
</Link> |
|
|
|
<Link |
|
|
|
<Link |
|
|
|
to="/ar" |
|
|
|
to="/ar" |
|
|
|
className={_.join( |
|
|
|
className={`flex lg:hidden rounded-sm p-1.5 ${ |
|
|
|
[ |
|
|
|
isDark ? "bg-blueC0 bg-opacity-10" : "shadow-sm" |
|
|
|
"rounded-sm p-1.5", |
|
|
|
}`}
|
|
|
|
isDark ? "bg-blueC0 bg-opacity-10" : " shadow-sm", |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
" " |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
style={{ |
|
|
|
style={{ |
|
|
|
border: `1px solid ${isDark ? "#D7E3FC20" : "#D7E3FC"}`, |
|
|
|
border: `1px solid ${isDark ? "#D7E3FC20" : "#D7E3FC"}`, |
|
|
|
}} |
|
|
|
}} |
|
|
@ -173,7 +199,7 @@ function Navbar({ |
|
|
|
isDark ? bookmarkDeactiveDarkIcon : bookmarkDeactiveLightIcon |
|
|
|
isDark ? bookmarkDeactiveDarkIcon : bookmarkDeactiveLightIcon |
|
|
|
} |
|
|
|
} |
|
|
|
alt="bookmark" |
|
|
|
alt="bookmark" |
|
|
|
className="w-7" |
|
|
|
className="w-7 flex lg:hidden" |
|
|
|
onClick={() => addToFavorite({ [bookmark]: location.getId() })} |
|
|
|
onClick={() => addToFavorite({ [bookmark]: location.getId() })} |
|
|
|
/> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
@ -181,83 +207,23 @@ function Navbar({ |
|
|
|
<img |
|
|
|
<img |
|
|
|
src={isDark ? dotsMenuDarkIcon : dotsMenuLightIcon} |
|
|
|
src={isDark ? dotsMenuDarkIcon : dotsMenuLightIcon} |
|
|
|
alt="menu" |
|
|
|
alt="menu" |
|
|
|
className="w-7 mr-2" |
|
|
|
className="w-7 mr-2 flex lg:hidden" |
|
|
|
/> |
|
|
|
/> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{title && back ? ( |
|
|
|
{title && back ? ( |
|
|
|
<img |
|
|
|
<img |
|
|
|
src={isDark ? arrowWhiteIcon : arrowBlueIcon} |
|
|
|
src={isDark ? arrowWhiteIcon : arrowBlueIcon} |
|
|
|
alt="back" |
|
|
|
alt="back" |
|
|
|
className={`w-6 transform ${isDark ? "" : "-rotate-180"}`} |
|
|
|
className={`w-6 flex lg:hidden transform ${ |
|
|
|
|
|
|
|
isDark ? "" : "-rotate-180" |
|
|
|
|
|
|
|
}`}
|
|
|
|
onClick={() => navigation(-1)} |
|
|
|
onClick={() => navigation(-1)} |
|
|
|
/> |
|
|
|
/> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
|
</div> |
|
|
|
{/* desktop */} |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Drawer drawerOpen={drawerOpen} setDrawerOpen={setDrawerOpen} /> |
|
|
|
|
|
|
|
{/* portrait end */} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
) : ( |
|
|
|
|
|
|
|
<header |
|
|
|
|
|
|
|
className={`w-full border-b border-gray-200 border-solid fixed top-0 right-0 bg-white z-20`} |
|
|
|
|
|
|
|
style={{ boxShadow: "0px 0px 10px rgba(0,0,0,0.1)" }} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div className={`w-11/12 mx-auto flex flex-col`}> |
|
|
|
|
|
|
|
<div className="w-full flex flex-row items-center py-3 relative justify-between h-ful"> |
|
|
|
|
|
|
|
<div className="flex flex-row items-center"> |
|
|
|
|
|
|
|
<Link |
|
|
|
|
|
|
|
to="/" |
|
|
|
|
|
|
|
className="flex flex-row items-center text-2xl font-black text-green7B" |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<img |
|
|
|
|
|
|
|
src={logoIcon} |
|
|
|
|
|
|
|
className="w-8 relative bottom-1 ml-1" |
|
|
|
|
|
|
|
alt="" |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
{window.t("دانوین")} |
|
|
|
|
|
|
|
</Link> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<ul className="flex flex-row list-none items-center relative top-0.5 mr-6"> |
|
|
|
|
|
|
|
{pages.map((page, index) => ( |
|
|
|
|
|
|
|
<li key={index}> |
|
|
|
|
|
|
|
<NavLink |
|
|
|
|
|
|
|
to={page.link} |
|
|
|
|
|
|
|
className="text-tiny py-2 px-4 mx-4" |
|
|
|
|
|
|
|
style={({ isActive }) => ({ |
|
|
|
|
|
|
|
color: isActive ? "rgb(19, 123, 79)" : "#202020", |
|
|
|
|
|
|
|
fontWeight: isActive ? "700" : "200", |
|
|
|
|
|
|
|
})} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{page.name} |
|
|
|
|
|
|
|
</NavLink> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
</ul> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{overLayer && ( |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
className="z-30 w-screen h-full fixed top-0 right-0 backdrop-filter blur-sm bg-opacity-60 bg-gray-600" |
|
|
|
|
|
|
|
onClick={() => setOverLayer(false)} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<div className="relative w-full h-full"> |
|
|
|
|
|
|
|
<div |
|
|
|
|
|
|
|
className="flex flex-col w-full absolute left-1/2 top-16 transform -translate-x-1/2 z-50 rounded-md" |
|
|
|
|
|
|
|
style={{ maxWidth: "calc(100vw / 3)" }} |
|
|
|
|
|
|
|
onClick={(e) => e.stopPropagation()} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
<Search onChange={(val) => setSearch(val)} /> |
|
|
|
|
|
|
|
{search && <SearchResult text={search} setText={setSearch} />} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex flex-row items-center"> |
|
|
|
|
|
|
|
<select |
|
|
|
<select |
|
|
|
style={{ width: "100px" }} |
|
|
|
style={{ width: "100px" }} |
|
|
|
className="flex items-center text-blueC0 border border-blueC0 px-1 rounded base py-1.5 ml-4 cursor-pointer" |
|
|
|
className="hidden lg:flex items-center text-blueC0 border border-blueC0 px-1 rounded base py-1.5 ml-4 cursor-pointer" |
|
|
|
> |
|
|
|
> |
|
|
|
{language.map((item, index) => ( |
|
|
|
{language.map((item, index) => ( |
|
|
|
<option |
|
|
|
<option |
|
|
@ -272,12 +238,12 @@ function Navbar({ |
|
|
|
<img |
|
|
|
<img |
|
|
|
src={searchIcon} |
|
|
|
src={searchIcon} |
|
|
|
alt="" |
|
|
|
alt="" |
|
|
|
className="w-7 ml-3 cursor-pointer" |
|
|
|
className="w-7 ml-3 cursor-pointer lg:flex hidden" |
|
|
|
onClick={() => setOverLayer(true)} |
|
|
|
onClick={() => setOverLayer(true)} |
|
|
|
/> |
|
|
|
/> |
|
|
|
|
|
|
|
|
|
|
|
{isLogin && ( |
|
|
|
{isLogin && ( |
|
|
|
<div className="flex justify-end items-center gap-4"> |
|
|
|
<div className="hidden lg:flex justify-end items-center gap-4"> |
|
|
|
<Link to="/cart" className="relative"> |
|
|
|
<Link to="/cart" className="relative"> |
|
|
|
<img src={cartIcon} alt="" className="w-8" /> |
|
|
|
<img src={cartIcon} alt="" className="w-8" /> |
|
|
|
<span className="absolute -right-2 -top-0.5 w-4 p-2.5 h-4 flex justify-center items-center bg-green-700 bg-opacity-100 rounded-full text-white text-xs"> |
|
|
|
<span className="absolute -right-2 -top-0.5 w-4 p-2.5 h-4 flex justify-center items-center bg-green-700 bg-opacity-100 rounded-full text-white text-xs"> |
|
|
@ -300,15 +266,17 @@ function Navbar({ |
|
|
|
) : ( |
|
|
|
) : ( |
|
|
|
<Link |
|
|
|
<Link |
|
|
|
to="/dashboard" |
|
|
|
to="/dashboard" |
|
|
|
className="bg-blueC0 font-semibold text-white rounded-md px-4 py-3 text-sm mr-7 hover:bg-opacity-90 shadow-sm" |
|
|
|
className="hidden lg:flex bg-blueC0 font-semibold text-white rounded-md px-4 py-3 text-sm mr-7 hover:bg-opacity-90 shadow-sm" |
|
|
|
> |
|
|
|
> |
|
|
|
{window.t("حساب کاربری")} |
|
|
|
{window.t("حساب کاربری")} |
|
|
|
</Link> |
|
|
|
</Link> |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
{/* desktop */} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Drawer drawerOpen={drawerOpen} setDrawerOpen={setDrawerOpen} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</header> |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|