@@ -132,54 +132,64 @@ export const HoverNavigation = ({
132132 </ div >
133133 </ motion . div >
134134 </ div >
135- < motion . div
136- animate = { {
137- width : navVisible ? "auto" : "0px" ,
138- opacity : navVisible ? "100%" : "0%" ,
139- } }
140- transition = { {
141- ease : "easeInOut" ,
142- } }
143- className = { cn (
144- "hidden w-0 flex-row items-center justify-center overflow-hidden lg:flex lg:w-auto" ,
145- className ,
146- ) }
135+ < nav
136+ aria-label = "Desktop Navigation"
137+ className = "flex items-center justify-center overflow-hidden"
147138 >
148- { items . map ( ( item , idx ) => (
149- < a
150- href = { item ?. link }
151- key = { item ?. link }
152- className = "group relative block h-fit px-5 py-2"
153- onMouseEnter = { ( ) => setHoveredIndex ( idx ) }
154- onMouseLeave = { ( ) => setHoveredIndex ( null ) }
155- >
156- < AnimatePresence >
157- { hoveredIndex === idx && (
158- < motion . span
159- className = "absolute inset-0 block h-full w-full rounded-3xl bg-neutral-200"
160- layoutId = "hoverBackground"
161- initial = { { opacity : 0 } }
162- animate = { {
163- opacity : 1 ,
164- transition : { duration : 0.15 } ,
165- } }
166- exit = { {
167- opacity : 0 ,
168- transition : {
169- duration : 0.15 ,
170- delay : 0.2 ,
171- } ,
172- } }
173- />
174- ) }
175- </ AnimatePresence >
176- < NavBarLink > { item . label } </ NavBarLink >
177- </ a >
178- ) ) }
179- </ motion . div >
139+ < motion . ul
140+ className = "hidden w-0 flex-row items-center justify-center overflow-hidden lg:flex lg:w-auto"
141+ animate = { {
142+ width : navVisible ? "auto" : "0px" ,
143+ opacity : navVisible ? "100%" : "0%" ,
144+ } }
145+ transition = { {
146+ ease : "easeInOut" ,
147+ } }
148+ >
149+ { items . map ( ( item , idx ) => (
150+ < li key = { item ?. link } >
151+ < a
152+ href = { item ?. link }
153+ className = "group relative block h-fit px-5 py-2"
154+ onMouseEnter = { ( ) =>
155+ setHoveredIndex ( idx )
156+ }
157+ onMouseLeave = { ( ) =>
158+ setHoveredIndex ( null )
159+ }
160+ >
161+ < AnimatePresence >
162+ { hoveredIndex === idx && (
163+ < motion . span
164+ className = "absolute inset-0 block h-full w-full rounded-3xl bg-neutral-200"
165+ layoutId = "hoverBackground"
166+ initial = { { opacity : 0 } }
167+ animate = { {
168+ opacity : 1 ,
169+ transition : {
170+ duration : 0.15 ,
171+ } ,
172+ } }
173+ exit = { {
174+ opacity : 0 ,
175+ transition : {
176+ duration : 0.15 ,
177+ delay : 0.2 ,
178+ } ,
179+ } }
180+ />
181+ ) }
182+ </ AnimatePresence >
183+ < NavBarLink > { item . label } </ NavBarLink >
184+ </ a >
185+ </ li >
186+ ) ) }
187+ </ motion . ul >
188+ </ nav >
180189
181190 < div className = "hamburger-wrapper flex items-center justify-center lg:hidden" >
182191 < HamburgerCross
192+ aria-label = "Hamburger"
183193 toggled = { hamburgerOpen }
184194 toggle = { setHamburgerOpen }
185195 size = { 20 }
@@ -200,13 +210,14 @@ export const HoverNavigation = ({
200210 className = "h-0 overflow-hidden"
201211 >
202212 { items . map ( ( item , idx ) => (
203- < a
204- href = { item ?. link }
205- key = { item ?. link }
206- className = "group relative block px-5 py-2 text-center lg:hidden"
207- >
208- { item . label }
209- </ a >
213+ < li key = { item ?. link } >
214+ < a
215+ href = { item ?. link }
216+ className = "group relative block px-5 py-2 text-center lg:hidden"
217+ >
218+ { item . label }
219+ </ a >
220+ </ li >
210221 ) ) }
211222 </ motion . ul >
212223 </ div >
0 commit comments