generated from 202306-NEA-DZ-FEW/capstone-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from 202306-NEA-DZ-FEW/5-navbar
5 navbar
- Loading branch information
Showing
7 changed files
with
364 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { useState } from "react"; | ||
import { BiLogOut } from "react-icons/bi"; | ||
import { MdAccountCircle } from "react-icons/md"; | ||
|
||
const AccountMenu = ({ logout }) => { | ||
const [openMenu, setOpenMenu] = useState(false); | ||
|
||
return ( | ||
<div className='relative items-center justify-end hidden md:flex '> | ||
<button | ||
onClick={() => setOpenMenu(!openMenu)} | ||
className='text-base font-medium text-black whitespace-nowrap hover:text-green' | ||
> | ||
<Image | ||
src='/images/account.svg' | ||
width={36} | ||
height={36} | ||
alt='account' | ||
/> | ||
</button> | ||
<div | ||
className={`${ | ||
openMenu ? "block" : "hidden" | ||
} absolute top-[115%] -right-4 transition p-3 w-48 h-fit bg-white shadow-lg rounded-lg`} | ||
> | ||
<div className='flex flex-col gap-4'> | ||
<Link | ||
href='/account' | ||
className=' text-black whitespace-nowrap hover:text-green' | ||
> | ||
<div className='flex flex-row items-center gap-3'> | ||
<MdAccountCircle className='text-3xl ' /> | ||
<span className='text-lg font-medium'> | ||
Your account | ||
</span> | ||
</div> | ||
</Link> | ||
<button | ||
onClick={logout} | ||
className='text-red whitespace-nowrap hover:opacity-75' | ||
> | ||
<div className='flex flex-row items-center gap-4 '> | ||
<BiLogOut className='text-3xl -ml-1' /> | ||
<span className='text-lg font-medium '> | ||
Log Out | ||
</span> | ||
</div> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AccountMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import Image from "next/image"; | ||
import Link from "next/link"; | ||
import { useState } from "react"; | ||
|
||
const LanguageMenu = () => { | ||
const [language, setLanguage] = useState("en"); | ||
const [openMenu, setOpenMenu] = useState(false); | ||
|
||
return ( | ||
<div className='relative items-center justify-end hidden md:flex '> | ||
<button | ||
onClick={() => setOpenMenu(!openMenu)} | ||
className='text-base font-medium text-black whitespace-nowrap hover:text-green' | ||
> | ||
<Image | ||
src={`/images/${language}-flag.svg`} | ||
width={36} | ||
height={36} | ||
alt={language == "en" ? "English" : "Arabic"} | ||
/> | ||
</button> | ||
<div | ||
className={`${ | ||
openMenu ? "block" : "hidden" | ||
} absolute top-[115%] -right-4 transition p-3 w-48 h-fit bg-white shadow-lg rounded-lg`} | ||
> | ||
<div className='flex flex-col gap-4'> | ||
<Link | ||
href='/' | ||
locale='en' | ||
className=' text-black whitespace-nowrap hover:text-green' | ||
> | ||
<div | ||
className='flex flex-row items-center gap-5' | ||
onClick={() => { | ||
setLanguage("en"); | ||
setOpenMenu(false); | ||
}} | ||
> | ||
<Image | ||
src='/images/en-flag.svg' | ||
width={36} | ||
height={36} | ||
alt='English' | ||
/> | ||
<span className='text-lg font-medium'>English</span> | ||
</div> | ||
</Link> | ||
<Link | ||
href='/' | ||
locale='ar' | ||
className=' text-base font-medium text-black whitespace-nowrap hover:text-green' | ||
> | ||
<div | ||
className='flex flex-row items-center gap-5' | ||
onClick={() => { | ||
setLanguage("ar"); | ||
setOpenMenu(false); | ||
}} | ||
> | ||
<Image | ||
src='/images/ar-flag.svg' | ||
width={36} | ||
height={36} | ||
alt='Arabic' | ||
/> | ||
<span className='text-xl font-medium'>العربية</span> | ||
</div> | ||
</Link> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default LanguageMenu; |
Oops, something went wrong.