Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added diary page link in the navbar #115

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading