Nine 82cb719ad6
Feature/hamburger menu (#540)
* Setup Mobile Menu Sidebar

* Setup Basic Mobile Menu Items Styling

* Implement full width styling for mobile devices

* Cleanup

Co-authored-by: Nine <at059214@Abdurahmans-MacBook-Pro.local>
2021-11-25 15:09:21 -03:00

42 lines
1012 B
TypeScript

import Link from 'next/link'
import s from './MenuSidebarView.module.css'
import { FC } from 'react'
import { useUI } from '@components/ui/context'
import SidebarLayout from '@components/common/SidebarLayout'
import { Link as LinkProps} from '.'
interface MenuProps {
links?: LinkProps[]
}
const MenuSidebarView: FC<MenuProps> = (props) => {
const { closeSidebar } = useUI()
const handleClose = () => closeSidebar()
return (
<SidebarLayout handleClose={handleClose}>
<div className={s.root}>
<nav>
<ul>
<li className={s.item}>
<Link href="/search">
<a>All</a>
</Link>
</li>
{props.links?.map((l: any) => (
<li key={l.href} className={s.item}>
<Link href={l.href}>
<a>{l.label}</a>
</Link>
</li>
))}
</ul>
</nav>
</div>
</SidebarLayout>
)
}
export default MenuSidebarView