Skip to content

Commit

Permalink
Rework mobile view to have main site link (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
byronwall authored Oct 22, 2023
1 parent 5d9c144 commit b93b64b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/components/common/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
Loader2,
type LucideProps,
Moon,
Menu,
MoreVertical,
Pizza,
Plus,
Expand Down Expand Up @@ -43,6 +44,7 @@ import {
export type Icon = LucideIcon;

export const Icons = {
menu: Menu,
shuffle: Shuffle,
trophy: Trophy,
star: Star,
Expand Down
8 changes: 6 additions & 2 deletions src/components/nav/main-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ export function MainNav({ items, children }: MainNavProps) {
className="flex items-center space-x-2 md:hidden"
onClick={() => setShowMobileMenu(!showMobileMenu)}
>
{showMobileMenu ? <Icons.close /> : <Icons.logo />}
<span className="font-bold">Menu</span>
{showMobileMenu ? <Icons.close /> : <Icons.menu />}
</button>

<Link href="/" className="flex items-center md:hidden">
<Icons.logo />
</Link>

{showMobileMenu && items && (
<MobileNav items={items} onClose={() => setShowMobileMenu(false)}>
{children}
Expand Down

0 comments on commit b93b64b

Please sign in to comment.