Skip to content

Commit

Permalink
fix: nav bar bg transition & mobile nav close btn
Browse files Browse the repository at this point in the history
  • Loading branch information
sonastea committed May 6, 2024
1 parent 39a7637 commit cdf3b7b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions client/src/components/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,17 @@ const NavBar = () => {
</div>

<div
className={`${!isActiveMobileNav && 'translate-x-full'} fixed right-0 z-50 h-screen
w-screen transform bg-transparent backdrop-brightness-50 ease-in-out md:hidden`}
className={`${isActiveMobileNav ? 'flex' : 'hidden'} fixed z-50 h-screen w-screen
bg-transparent backdrop-brightness-50 duration-150 md:hidden`}
onClick={() => setMobileNav((prev) => !prev)}
aria-label="Toggle mobile nav"
/>

<div
id="mobileNav"
className={`${!isActiveMobileNav && 'translate-x-full'} fixed right-0 z-100 h-screen
w-3/4 transform overflow-auto rounded-l bg-white py-6 pl-6 pr-10 shadow-md duration-300
ease-in-out sm:w-64 md:hidden`}
className={`${!isActiveMobileNav && 'translate-x-full duration-100'} fixed right-0 z-100
h-screen w-3/4 transform overflow-auto rounded-l bg-white py-6 pl-6 pr-10 shadow-md
duration-300 ease-in-out sm:w-64 md:hidden`}
>
<Link
className="aspect-w-2 aspect-h-1 inline-block w-32 sm:w-48"
Expand All @@ -214,7 +215,7 @@ const NavBar = () => {
</Link>
<div>
<button
className="absolute right-4 top-4 px-2 py-1"
className="absolute right-4 top-4 px-2.5 py-2"
aria-label="Toggle mobile nav"
onClick={() => setMobileNav((prev) => !prev)}
>
Expand Down

0 comments on commit cdf3b7b

Please sign in to comment.