1
1
'use client'
2
2
3
- import { Dialog , Transition } from '@headlessui/react'
3
+ import { Dialog , DialogPanel , Transition , TransitionChild } from '@headlessui/react'
4
4
import { disableBodyScroll , enableBodyScroll , clearAllBodyScrollLocks } from 'body-scroll-lock'
5
5
import { Fragment , useState , useEffect , useRef } from 'react'
6
6
import Link from './Link'
@@ -33,7 +33,7 @@ const MobileNav = () => {
33
33
xmlns = "http://www.w3.org/2000/svg"
34
34
viewBox = "0 0 20 20"
35
35
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 "
37
37
>
38
38
< path
39
39
fillRule = "evenodd"
@@ -44,7 +44,7 @@ const MobileNav = () => {
44
44
</ button >
45
45
< Transition appear show = { navShow } as = { Fragment } unmount = { false } >
46
46
< Dialog as = "div" onClose = { onToggleNav } unmount = { false } >
47
- < Transition . Child
47
+ < TransitionChild
48
48
as = { Fragment }
49
49
enter = "ease-out duration-300"
50
50
enterFrom = "opacity-0"
@@ -55,9 +55,9 @@ const MobileNav = () => {
55
55
unmount = { false }
56
56
>
57
57
< div className = "fixed inset-0 z-60 bg-black/25" />
58
- </ Transition . Child >
58
+ </ TransitionChild >
59
59
60
- < Transition . Child
60
+ < TransitionChild
61
61
as = { Fragment }
62
62
enter = "transition ease-in-out duration-300 transform"
63
63
enterFrom = "translate-x-full opacity-0"
@@ -67,16 +67,16 @@ const MobileNav = () => {
67
67
leaveTo = "translate-x-full opacity-0"
68
68
unmount = { false }
69
69
>
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 " >
71
71
< nav
72
72
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"
74
74
>
75
75
{ headerNavLinks . map ( ( link ) => (
76
76
< Link
77
77
key = { link . title }
78
78
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"
80
80
onClick = { onToggleNav }
81
81
>
82
82
{ link . title }
@@ -85,7 +85,7 @@ const MobileNav = () => {
85
85
</ nav >
86
86
87
87
< 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"
89
89
aria-label = "Toggle Menu"
90
90
onClick = { onToggleNav }
91
91
>
@@ -97,8 +97,8 @@ const MobileNav = () => {
97
97
/>
98
98
</ svg >
99
99
</ button >
100
- </ Dialog . Panel >
101
- </ Transition . Child >
100
+ </ DialogPanel >
101
+ </ TransitionChild >
102
102
</ Dialog >
103
103
</ Transition >
104
104
</ >
0 commit comments