Drop Down Menu Fixed

main
Pedram Keshavarzi 3 years ago
parent 35875fda6c
commit 1c72a83db6
  1. 1
      src/components/exam/Carousel/index.css
  2. 41
      src/components/header/Header.js
  3. 7
      src/components/header/Header.scss

@ -146,6 +146,7 @@
.melc-c-i-i-exam-sit{
position: absolute;
z-index: 20;
top: 20px;
left: 10px;
padding: 5px 5px;

@ -12,6 +12,7 @@ import { Link } from 'react-router-dom';
import arrowIcon from './MobileSideMenu/arrow-down.svg'
import exitIcon from '../../assets/img/group-9.svg'
import backIcon from './arrow-left-1.svg';
import profileIcon from './MobileSideMenu/profile-active.svg'
const Header = ({
isMobile, cart,
logOut
@ -36,12 +37,18 @@ const Header = ({
subMenu && <div className={`w-1/6 p-4 flex flex-col text-right bg-white shadow-xl absolute top-[108.5%] rounded-lg left-5 transition duration-700 ease-in-out ${subMenu && 'subMenu'}`}
>
<div className='flex items-center rtl text-right w-full py-2'>
<img src={profileIcon} />
کوروش زراندوز ( معلم شیمی )
</div>
<Link to='/adminpanel' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
ورود به پنل ادمین
</Link>
<Link to='/adminpanel/add-exam' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
{/* <Link to='/adminpanel/add-exam' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
ورود به صفحه افزودن آزمون
</Link>
</Link> */}
<Link to='/register' onClick={() => setSubMenu(false)} className='w-full text-right border-b border-gray-200 py-2'>
افزودن حساب کاربری جدید
</Link>
@ -61,22 +68,22 @@ const Header = ({
<Link to='/'> <img src={logoIcon} className="h-10" /> </Link>
{
location.pathname.includes('messages') ? (
<div onClick={() => navigate(-1)} className="w-8 h-8 bg-red-100 rounded-md flex items-center justify-center">
<img src={backIcon} className="h-4/5"/>
<div onClick={() => navigate(-1)} className="w-8 h-8 bg-red-100 rounded-md flex items-center justify-center">
<img src={backIcon} className="h-4/5" />
</div>
): (
) : (
<Link to='/shoppingCart'>
<div className='flex flex-col'>
<div className='absolute left-8 top-3 bg-red52 w-4 h-4 rounded-full text-xs flex items-center justify-center text-white'>{cart?.length}</div>
<svg width="35" height="35" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.5 7.67001V6.70001C7.5 4.45001 9.31 2.24001 11.56 2.03001C14.24 1.77001 16.5 3.88001 16.5 6.51001V7.89001" stroke="#df1452" strokeWidth="1.5" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" />
<path d="M8.99999 22H15C19.02 22 19.74 20.39 19.95 18.43L20.7 12.43C20.97 9.99 20.27 8 16 8H7.99999C3.72999 8 3.02999 9.99 3.29999 12.43L4.04999 18.43C4.25999 20.39 4.97999 22 8.99999 22Z" stroke="#df1452" strokeWidth="1.5" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" />
<path d="M15.4955 12H15.5045" stroke="#df1452" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
<path d="M8.49451 12H8.50349" stroke="#df1452" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</div>
</Link>
<div className='flex flex-col'>
<div className='absolute left-8 top-3 bg-red52 w-4 h-4 rounded-full text-xs flex items-center justify-center text-white'>{cart?.length}</div>
<svg width="35" height="35" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7.5 7.67001V6.70001C7.5 4.45001 9.31 2.24001 11.56 2.03001C14.24 1.77001 16.5 3.88001 16.5 6.51001V7.89001" stroke="#df1452" strokeWidth="1.5" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" />
<path d="M8.99999 22H15C19.02 22 19.74 20.39 19.95 18.43L20.7 12.43C20.97 9.99 20.27 8 16 8H7.99999C3.72999 8 3.02999 9.99 3.29999 12.43L4.04999 18.43C4.25999 20.39 4.97999 22 8.99999 22Z" stroke="#df1452" strokeWidth="1.5" strokeMiterlimit="10" strokeLinecap="round" strokeLinejoin="round" />
<path d="M15.4955 12H15.5045" stroke="#df1452" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
<path d="M8.49451 12H8.50349" stroke="#df1452" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
</svg>
</div>
</Link>
)
}
</div> :
@ -84,7 +91,7 @@ const Header = ({
{location.pathname.includes('adminpanel') ? <div></div> :
<>
<div className="header-profile h-full flex items-center">
<img src={arrowIcon} className=" ml-4 w-6" onClick={() => setSubMenu(!subMenu)} />
<img src={arrowIcon} className={`cursor-pointer ml-4 w-6 ${subMenu && 'transform rotate-180 duration-900 transition'}`} onClick={() => setSubMenu(!subMenu)} />
<div className="header-profile-img-container w-10 h-10 bg-color2 ml-2 rounded-full overflow-hidden">
<img src={avatar1} alt="avatar1" className='w-full' />
</div>

@ -26,11 +26,12 @@ $RegularFont:"IRANSansX-Regular";
@keyframes fadeInAnimation {
0% {
height: 0px;
// height: 0px;
opacity: 0;
}
100% {
height: 200px;
height: fit-content;
opacity: 1;
}
}
Loading…
Cancel
Save