forked from vercel/commerce
-
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.
* Setup Mobile Menu Sidebar * Setup Basic Mobile Menu Items Styling * Implement full width styling for mobile devices * Cleanup Co-authored-by: Nine <[email protected]>
- Loading branch information
Nine
and
Nine
authored
Nov 25, 2021
1 parent
a01568b
commit 82cb719
Showing
10 changed files
with
123 additions
and
17 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ interface Link { | |
href: string | ||
label: string | ||
} | ||
|
||
interface NavbarProps { | ||
links?: Link[] | ||
} | ||
|
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
7 changes: 7 additions & 0 deletions
7
components/common/UserNav/MenuSidebarView/MenuSidebarView.module.css
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,7 @@ | ||
.root { | ||
@apply px-4 sm:px-6 sm:w-full flex-1 z-20; | ||
} | ||
|
||
.item { | ||
@apply text-2xl font-bold; | ||
} |
41 changes: 41 additions & 0 deletions
41
components/common/UserNav/MenuSidebarView/MenuSidebarView.tsx
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,41 @@ | ||
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 |
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,6 @@ | ||
export { default } from './MenuSidebarView' | ||
|
||
export interface Link { | ||
href: string | ||
label: string | ||
} |
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
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
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,21 @@ | ||
const Menu = ({ ...props }) => { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
className="h-6 w-6" | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
stroke="currentColor" | ||
{...props} | ||
> | ||
<path | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth={2} | ||
d="M4 6h16M4 12h16m-7 6h7" | ||
/> | ||
</svg> | ||
) | ||
} | ||
|
||
export default Menu |
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