Skip to content

Commit

Permalink
fix(components/navigation/bar): hide hamburger menu on homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnigos committed Nov 17, 2024
1 parent 8ec53a2 commit 9ebfa22
Showing 1 changed file with 27 additions and 25 deletions.
52 changes: 27 additions & 25 deletions app/components/navigation/navigation-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,33 +63,35 @@ function NavigationBar({ user, userId }: NavigationBar.Props) {
className="hidden rounded-lg lg:block"
/>

<div className="h-[28px] w-[28px] lg:hidden">
<Sheet
open={isSidebarOpen}
onOpenChange={isOpen => {
setIsSidebarOpen(isOpen)
}}
>
<SheetTrigger
onClick={() => {
setIsSidebarOpen(true)
{pathname.includes('profile') && (

Check failure on line 66 in app/components/navigation/navigation-bar.tsx

View workflow job for this annotation

GitHub Actions / Test 🧪

app/components/navigation/navigation-bar.spec.tsx > NavigationBar > should match snapshot as unauthenticated

TypeError: Cannot read properties of null (reading 'includes') ❯ NavigationBar app/components/navigation/navigation-bar.tsx:66:19 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22

Check failure on line 66 in app/components/navigation/navigation-bar.tsx

View workflow job for this annotation

GitHub Actions / Test 🧪

app/components/navigation/navigation-bar.spec.tsx > NavigationBar > should match snapshot as authenticated

TypeError: Cannot read properties of null (reading 'includes') ❯ NavigationBar app/components/navigation/navigation-bar.tsx:66:19 ❯ renderWithHooks node_modules/react-dom/cjs/react-dom.development.js:15486:18 ❯ mountIndeterminateComponent node_modules/react-dom/cjs/react-dom.development.js:20103:13 ❯ beginWork node_modules/react-dom/cjs/react-dom.development.js:21626:16 ❯ beginWork$1 node_modules/react-dom/cjs/react-dom.development.js:27465:14 ❯ performUnitOfWork node_modules/react-dom/cjs/react-dom.development.js:26599:12 ❯ workLoopSync node_modules/react-dom/cjs/react-dom.development.js:26505:5 ❯ renderRootSync node_modules/react-dom/cjs/react-dom.development.js:26473:7 ❯ recoverFromConcurrentError node_modules/react-dom/cjs/react-dom.development.js:25889:20 ❯ performConcurrentWorkOnRoot node_modules/react-dom/cjs/react-dom.development.js:25789:22
<div className="h-[28px] w-[28px] lg:hidden">
<Sheet
open={isSidebarOpen}
onOpenChange={isOpen => {
setIsSidebarOpen(isOpen)
}}
className="cursor-pointer"
>
{isSidebarOpen ? (
<IoClose size={28} />
) : (
<RxHamburgerMenu size={28} />
)}
</SheetTrigger>

<SheetContent side="bottom">
<div className="min-h-[50vh]">
<Sidebar />
</div>
</SheetContent>
</Sheet>
</div>
<SheetTrigger
onClick={() => {
setIsSidebarOpen(true)
}}
className="cursor-pointer"
>
{isSidebarOpen ? (
<IoClose size={28} />
) : (
<RxHamburgerMenu size={28} />
)}
</SheetTrigger>

<SheetContent side="bottom">
<div className="min-h-[50vh]">
<Sidebar />
</div>
</SheetContent>
</Sheet>
</div>
)}

<h1 className="hidden text-2xl font-semibold md:block md:text-3xl">
rigtch.fm
Expand Down

0 comments on commit 9ebfa22

Please sign in to comment.