@@ -35,6 +35,17 @@ export default function Layout({
35
35
36
36
const mobileNavRef = useRef < HTMLDivElement > ( null ) ;
37
37
38
+ useEffect ( ( ) => {
39
+ if ( showMobileNav ) {
40
+ document . body . style . overflow = 'hidden' ;
41
+ } else {
42
+ document . body . style . overflow = 'unset' ;
43
+ }
44
+ return ( ) => {
45
+ document . body . style . overflow = 'unset' ;
46
+ } ;
47
+ } , [ showMobileNav ] ) ;
48
+
38
49
React . useEffect (
39
50
( ) => useStore . setState ( { overlayNavigation : null } ) ,
40
51
[ router . asPath ] ,
@@ -103,7 +114,13 @@ export default function Layout({
103
114
< MainNavigation />
104
115
</ div >
105
116
</ header >
106
- < div ref = { mobileNavRef } >
117
+ < div
118
+ ref = { mobileNavRef }
119
+ className = { classnames ( 'transition-all duration-300 ease-in-out' , {
120
+ 'mt-[280px]' : showMobileNav ,
121
+ 'mt-[64px]' : ! showMobileNav ,
122
+ } ) }
123
+ >
107
124
{ showMobileNav && < MobileNav /> }
108
125
{ children }
109
126
</ div >
@@ -293,29 +310,40 @@ const MobileNav = () => {
293
310
const section = useContext ( SectionContext ) ;
294
311
295
312
return (
296
- < div className = 'flex flex-col lg:hidden shadow-xl justify-end fixed bg-white w-full z-[190] top-16 left-0 pl-8 dark:bg-slate-800' >
297
- < MainNavLink
298
- uri = '/specification'
299
- label = 'Specification'
300
- isActive = { section === 'specification' }
301
- />
302
- < MainNavLink
303
- uri = '/learn/getting-started-step-by-step'
304
- label = 'Docs'
305
- isActive = { section === 'docs' }
306
- />
313
+ < div className = 'flex flex-col lg:hidden shadow-xl fixed bg-white w-full z-[190] top-16 left-0 pl-8 dark:bg-slate-800 transition-all duration-300 ease-in-out' >
314
+ < div className = 'flex flex-col space-y-2 py-2' >
315
+ < MainNavLink
316
+ className = 'block py-1.5'
317
+ uri = '/specification'
318
+ label = 'Specification'
319
+ isActive = { section === 'specification' }
320
+ />
321
+ < MainNavLink
322
+ className = 'block py-1.5'
323
+ uri = '/learn/getting-started-step-by-step'
324
+ label = 'Docs'
325
+ isActive = { section === 'docs' }
326
+ />
307
327
308
- < MainNavLink
309
- uri = '/tools?query=& sortBy = name & sortOrder = ascending & groupBy = toolingTypes & licenses = & languages = & drafts = & toolingTypes = & environments = '
310
- label=' Tools '
311
- isActive = { section === 'tools' }
312
- />
313
- < MainNavLink uri = '/blog' label = 'Blog' isActive = { section === 'blog' } />
314
- < MainNavLink
315
- uri = '/community'
316
- label = 'Community'
317
- isActive = { section === 'community' }
318
- />
328
+ < MainNavLink
329
+ className = 'block py-1.5'
330
+ uri = '/tools?query=& sortBy = name & sortOrder = ascending & groupBy = toolingTypes & licenses = & languages = & drafts = & toolingTypes = & environments = '
331
+ label=' Tools '
332
+ isActive = { section === 'tools' }
333
+ />
334
+ < MainNavLink
335
+ className = 'block py-1.5'
336
+ uri = '/blog'
337
+ label = 'Blog'
338
+ isActive = { section === 'blog' }
339
+ />
340
+ < MainNavLink
341
+ className = 'block py-1.5'
342
+ uri = '/community'
343
+ label = 'Community'
344
+ isActive = { section === 'community' }
345
+ />
346
+ </ div >
319
347
</ div >
320
348
) ;
321
349
} ;
0 commit comments