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

fix: map to render nav links for mobile navbar #1553

Merged
merged 6 commits into from
Jul 4, 2023
Merged
Changes from 5 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
32 changes: 12 additions & 20 deletions components/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ function SideMenu(props: { handleDrawerToggle: () => void }) {
},
];

const linksComponent = sideLinks.map((link, index) => (
<li>
adity2911 marked this conversation as resolved.
Show resolved Hide resolved
<Link href={link.path} key={index} rel="noreferrer" className={`block py-2 px-3 w-fit m-2 text-left font-bold rounded-md`} aria-label="Github">
adity2911 marked this conversation as resolved.
Show resolved Hide resolved
{link.name}
</Link>
</li>
)
)


return (
<div
className=" h-screen flex flex-col bg-secondary text-white "
Expand Down Expand Up @@ -49,26 +59,7 @@ function SideMenu(props: { handleDrawerToggle: () => void }) {

{/* SideBar navlinks section */}
<ul className="block">
<li>
<Link
href="/projects"
rel="noreferrer"
className={`block py-2 px-3 w-fit m-2 text-left rounded-md`}
aria-label="Github"
>
Projects
</Link>
</li>
<li>
<Link
href="/docs"
rel="noreferrer"
className={`block py-2 px-3 w-fit m-2 text-left rounded-md`}
aria-label="Github"
>
Docs
</Link>
</li>
{linksComponent}
<li>
<a
href="https://github.com/priyankarpal/ProjectsHut"
Expand All @@ -85,4 +76,5 @@ function SideMenu(props: { handleDrawerToggle: () => void }) {
);
}


export default SideMenu;