Skip to content

Commit

Permalink
Added diary page link in the navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi0049k committed Oct 14, 2024
1 parent aa9e1c9 commit 27b3e6a
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,36 @@ import Link from 'next/link';
import { useState } from 'react';

const items = [
{link:"/", name: "Home"},
{link:"/notes", name: "Notes"},
{link:"/daily-quote", name: "Daily Quote"},
{link:"/about", name: "About"},
{link:"/guestbook", name: "Guestbook"},

{ link: "/", name: "Home" },
{ link: "/notes", name: "Notes" },
{ link: "/daily-quote", name: "Daily Quote" },
{ link: "/about", name: "About" },
{ link: "/guestbook", name: "Guestbook" },
{ link: "/diary", name: "Diary" }
]

export default function Navbar() {
const [open, setOpen] = useState(true)
return (
<>
<button className='sm:hidden z-10' onClick={()=>setOpen(!open)}>
<button className='sm:hidden z-10' onClick={() => setOpen(!open)}>

{ !open ? <Menu /> :
<CircleX />}
{!open ? <Menu /> :
<CircleX />}
</button>
{
// open &&
<nav className={`flex-col absolute top-0 left-0 items-center h-screen sm:h-auto ${open ? 'w-full' : 'hidden'} sm:flex sm:w-auto bg-[#171717] sm:bg-transparent z-[2] sm:relative sm:flex-row flex gap-8 justify-center sm:space-x-8 p-4 text-white`}>
{
items.map((item, index)=>(
<div key={index} className='py-2 group'>
<Link href={item.link} onClick={()=>setOpen(false)}> {item.name} </Link>
<div className='w-0 group-hover:w-full h-[2px] rounded-full bg-white transition-all delay-750'></div>
</div>
))
}
</nav>
{
items.map((item, index) => (
<div key={index} className='py-2 group'>
<Link href={item.link} onClick={() => setOpen(false)}> {item.name} </Link>
<div className='w-0 group-hover:w-full h-[2px] rounded-full bg-white transition-all delay-750'></div>
</div>
))
}

</nav>
}
</>
);
Expand Down

0 comments on commit 27b3e6a

Please sign in to comment.