11'use client'
22
3- import { Dialog , Transition } from '@headlessui/react'
3+ import { Dialog , DialogPanel , Transition , TransitionChild } from '@headlessui/react'
44import { disableBodyScroll , enableBodyScroll , clearAllBodyScrollLocks } from 'body-scroll-lock'
55import { Fragment , useState , useEffect , useRef } from 'react'
66import Link from './Link'
@@ -33,7 +33,7 @@ const MobileNav = () => {
3333 xmlns = "http://www.w3.org/2000/svg"
3434 viewBox = "0 0 20 20"
3535 fill = "currentColor"
36- className = "h-8 w-8 text-gray-900 hover:text-primary-500 dark: text-gray-100 dark:hover: text-primary-400 "
36+ className = "hover: text-primary-500 dark: hover:text-primary-400 h-8 w-8 text-gray-900 dark:text-gray-100 "
3737 >
3838 < path
3939 fillRule = "evenodd"
@@ -44,7 +44,7 @@ const MobileNav = () => {
4444 </ button >
4545 < Transition appear show = { navShow } as = { Fragment } unmount = { false } >
4646 < Dialog as = "div" onClose = { onToggleNav } unmount = { false } >
47- < Transition . Child
47+ < TransitionChild
4848 as = { Fragment }
4949 enter = "ease-out duration-300"
5050 enterFrom = "opacity-0"
@@ -55,9 +55,9 @@ const MobileNav = () => {
5555 unmount = { false }
5656 >
5757 < div className = "fixed inset-0 z-60 bg-black/25" />
58- </ Transition . Child >
58+ </ TransitionChild >
5959
60- < Transition . Child
60+ < TransitionChild
6161 as = { Fragment }
6262 enter = "transition ease-in-out duration-300 transform"
6363 enterFrom = "translate-x-full opacity-0"
@@ -67,16 +67,16 @@ const MobileNav = () => {
6767 leaveTo = "translate-x-full opacity-0"
6868 unmount = { false }
6969 >
70- < Dialog . Panel className = "fixed left -0 top -0 z-70 h-full w-full bg-white opacity- 95 duration-300 dark:bg-gray-950 dark:opacity-[0.98] " >
70+ < DialogPanel className = "fixed top -0 left -0 z-70 h-full w-full bg-white/ 95 duration-300 dark:bg-gray-950/98 " >
7171 < nav
7272 ref = { navRef }
73- className = "mt-8 flex h-full basis-0 flex-col items-start overflow-y-auto pl-12 pt-2 text-left"
73+ className = "mt-8 flex h-full basis-0 flex-col items-start overflow-y-auto pt-2 pl-12 text-left"
7474 >
7575 { headerNavLinks . map ( ( link ) => (
7676 < Link
7777 key = { link . title }
7878 href = { link . href }
79- className = "mb-4 py-2 pr-4 text-2xl font-bold tracking-widest text-gray-900 outline outline-0 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400 "
79+ className = "hover:text-primary-500 dark:hover:text-primary-400 mb-4 py-2 pr-4 text-2xl font-bold tracking-widest text-gray-900 outline outline-0 dark:text-gray-100"
8080 onClick = { onToggleNav }
8181 >
8282 { link . title }
@@ -85,7 +85,7 @@ const MobileNav = () => {
8585 </ nav >
8686
8787 < button
88- className = "fixed right-4 top-7 z-80 h-16 w-16 p-4 text-gray-900 hover:text-primary-500 dark:text-gray-100 dark:hover:text-primary-400 "
88+ className = "hover:text-primary-500 dark:hover:text-primary-400 fixed top-7 right-4 z-80 h-16 w-16 p-4 text-gray-900 dark:text-gray-100"
8989 aria-label = "Toggle Menu"
9090 onClick = { onToggleNav }
9191 >
@@ -97,8 +97,8 @@ const MobileNav = () => {
9797 />
9898 </ svg >
9999 </ button >
100- </ Dialog . Panel >
101- </ Transition . Child >
100+ </ DialogPanel >
101+ </ TransitionChild >
102102 </ Dialog >
103103 </ Transition >
104104 </ >
0 commit comments