44
55import * as React from 'react' ;
66
7- import { disableBodyScroll , enableBodyScroll } from 'body-scroll-lock' ;
87import {
98 Suspense ,
109 startTransition ,
@@ -13,18 +12,19 @@ import {
1312 useRef ,
1413 useState ,
1514} from 'react' ;
15+ import { disableBodyScroll , enableBodyScroll } from 'body-scroll-lock' ;
1616
17- import cn from 'classnames ' ;
17+ import { Feedback } from '../Feedback ' ;
1818import { IconClose } from 'components/Icon/IconClose' ;
1919import { IconHamburger } from 'components/Icon/IconHamburger' ;
2020import { IconSearch } from 'components/Icon/IconSearch' ;
21- import { Search } from 'components/Search' ;
22- import NextLink from 'next/link' ;
23- import { useRouter } from 'next/router' ;
2421import { Logo } from '../../Logo' ;
25- import { Feedback } from '../Feedback' ;
26- import { SidebarRouteTree } from '../Sidebar/SidebarRouteTree' ;
22+ import NextLink from 'next/link' ;
2723import type { RouteItem } from '../getRouteMeta' ;
24+ import { Search } from 'components/Search' ;
25+ import { SidebarRouteTree } from '../Sidebar/SidebarRouteTree' ;
26+ import cn from 'classnames' ;
27+ import { useRouter } from 'next/router' ;
2828
2929declare global {
3030 interface Window {
@@ -98,7 +98,7 @@ function Link({
9898 return (
9999 < NextLink
100100 href = { `${ href } ` }
101- className = "inline text-primary dark:text-primary-dark hover:text-link hover:dark:text-link-dark border-b border- link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal "
101+ className = "inline leading-normal transition duration-100 ease-in border-b border-opacity-0 text-primary dark:text-primary-dark hover:text-link hover:dark:text-link-dark border-link hover:border-opacity-100"
102102 { ...props } >
103103 { children }
104104 </ NextLink >
@@ -234,8 +234,8 @@ export default function TopNav({
234234 'duration-300 backdrop-filter backdrop-blur-lg backdrop-saturate-200 transition-shadow bg-opacity-90 items-center w-full flex justify-between bg-wash dark:bg-wash-dark dark:bg-opacity-95 px-1.5 lg:pe-5 lg:ps-4 z-50' ,
235235 { 'dark:shadow-nav-dark shadow-nav' : isScrolled || isOpen }
236236 ) } >
237- < div className = "h-16 w-full gap-0 sm:gap-3 flex items-center justify-between " >
238- < div className = "3xl: flex-1 flex flex-row " >
237+ < div className = "flex items-center justify-between w-full h-16 gap-0 sm:gap-3" >
238+ < div className = "flex flex-row 3xl: flex-1 " >
239239 < button
240240 type = "button"
241241 aria-label = "Menu"
@@ -248,7 +248,7 @@ export default function TopNav({
248248 ) } >
249249 { isOpen ? < IconClose /> : < IconHamburger /> }
250250 </ button >
251- < div className = "3xl:flex-1 flex align-center" >
251+ < div className = "flex 3xl:flex-1 align-center" >
252252 < NextLink
253253 href = "/"
254254 className = { `active:scale-95 overflow-hidden transition-transform relative items-center text-primary dark:text-primary-dark p-1 whitespace-nowrap outline-link rounded-full 3xl:rounded-xl inline-flex text-lg font-normal gap-2` } >
@@ -261,16 +261,16 @@ export default function TopNav({
261261 </ NextLink >
262262 </ div >
263263 </ div >
264- < div className = "hidden md:flex flex-1 justify-center items-center w-full 3xl:w-auto 3xl:shrink-0 3xl:justify-center" >
264+ < div className = "items-center justify-center flex-1 hidden w-full md:flex 3xl:w-auto 3xl:shrink-0 3xl:justify-center" >
265265 < button
266266 type = "button"
267267 className = { cn (
268268 'flex 3xl:w-[56rem] 3xl:mx-0 relative ps-4 pe-1 py-1 h-10 bg-gray-30/20 dark:bg-gray-40/20 outline-none focus:outline-link betterhover:hover:bg-opacity-80 pointer items-center text-start w-full text-gray-30 rounded-full align-middle text-base'
269269 ) }
270270 onClick = { onOpenSearch } >
271- < IconSearch className = "me-3 align-middle text-gray-30 shrink-0 group-betterhover:hover:text-gray-70" />
271+ < IconSearch className = "align-middle me-3 text-gray-30 shrink-0 group-betterhover:hover:text-gray-70" />
272272 Recherche
273- < span className = "ms-auto hidden sm:flex item-center me-1" >
273+ < span className = "hidden ms-auto sm:flex item-center me-1" >
274274 < Kbd data-platform = "mac" > ⌘</ Kbd >
275275 < Kbd data-platform = "win" wide >
276276 Ctrl
@@ -302,9 +302,9 @@ export default function TopNav({
302302 < button
303303 aria-label = "Search"
304304 type = "button"
305- className = "active:scale-95 transition-transform flex md:hidden w-12 h-12 rounded-full items-center justify-center hover:bg-secondary-button hover:dark:bg-secondary-button-dark outline-link"
305+ className = "flex items-center justify-center w-12 h-12 transition-transform rounded-full active:scale-95 md:hidden hover:bg-secondary-button hover:dark:bg-secondary-button-dark outline-link"
306306 onClick = { onOpenSearch } >
307- < IconSearch className = "align-middle w-5 h-5" />
307+ < IconSearch className = "w-5 h-5 align-middle " />
308308 </ button >
309309 </ div >
310310 < div className = "flex dark:hidden" >
@@ -314,7 +314,7 @@ export default function TopNav({
314314 onClick = { ( ) => {
315315 window . __setPreferredTheme ( 'dark' ) ;
316316 } }
317- className = "active:scale-95 transition-transform flex w-12 h-12 rounded-full items-center justify-center hover:bg-primary/5 hover:dark:bg-primary-dark/5 outline-link" >
317+ className = "flex items-center justify-center w-12 h-12 transition-transform rounded-full active:scale-95 hover:bg-primary/5 hover:dark:bg-primary-dark/5 outline-link" >
318318 { darkIcon }
319319 </ button >
320320 </ div >
@@ -325,7 +325,7 @@ export default function TopNav({
325325 onClick = { ( ) => {
326326 window . __setPreferredTheme ( 'light' ) ;
327327 } }
328- className = "active:scale-95 transition-transform flex w-12 h-12 rounded-full items-center justify-center hover:bg-primary/5 hover:dark:bg-primary-dark/5 outline-link" >
328+ className = "flex items-center justify-center w-12 h-12 transition-transform rounded-full active:scale-95 hover:bg-primary/5 hover:dark:bg-primary-dark/5 outline-link" >
329329 { lightIcon }
330330 </ button >
331331 </ div >
@@ -335,7 +335,7 @@ export default function TopNav({
335335 target = "_blank"
336336 rel = "noreferrer noopener"
337337 aria-label = "Open on GitHub"
338- className = "active:scale-95 transition-transform flex w-12 h-12 rounded-full items-center justify-center hover:bg-primary/5 hover:dark:bg-primary-dark/5 outline-link" >
338+ className = "flex items-center justify-center w-12 h-12 transition-transform rounded-full active:scale-95 hover:bg-primary/5 hover:dark:bg-primary-dark/5 outline-link" >
339339 { githubIcon }
340340 </ Link >
341341 </ div >
@@ -350,13 +350,13 @@ export default function TopNav({
350350 className = "overflow-y-scroll isolate no-bg-scrollbar lg:w-[342px] grow bg-wash dark:bg-wash-dark" >
351351 < aside
352352 className = { cn (
353- `lg:grow lg:flex flex-col w-full pb-8 lg:pb-0 lg:max-w-xs z-50` ,
353+ `lg:grow lg:flex flex-col w-full pb-8 lg:pb-0 lg:max-w-custom- xs z-50` ,
354354 isOpen ? 'block z-40' : 'hidden lg:block'
355355 ) } >
356356 < nav
357357 role = "navigation"
358358 style = { { '--bg-opacity' : '.2' } as React . CSSProperties } // Need to cast here because CSS vars aren't considered valid in TS types (cuz they could be anything)
359- className = "w-full lg:h-auto grow pe-0 lg:pe-5 pt-4 lg:py-6 md:pt-4 lg:pt-4 scrolling-touch scrolling-gpu" >
359+ className = "w-full pt-4 scrolling-touch lg:h-auto grow pe-0 lg:pe-5 lg:py-6 md:pt-4 lg:pt-4 scrolling-gpu" >
360360 { /* No fallback UI so need to be careful not to suspend directly inside. */ }
361361 < Suspense fallback = { null } >
362362 < div className = "ps-3 xs:ps-5 xs:gap-0.5 xs:text-base overflow-x-auto flex flex-row lg:hidden text-base font-bold text-secondary dark:text-secondary-dark" >
@@ -379,7 +379,7 @@ export default function TopNav({
379379 </ div >
380380 < div
381381 role = "separator"
382- className = "ms-5 mt-4 mb-2 border-b border-border dark:border-border-dark"
382+ className = "mt-4 mb-2 border-b ms-5 border-border dark:border-border-dark"
383383 />
384384 < SidebarRouteTree
385385 // Don't share state between the desktop and mobile versions.
0 commit comments