4
4
5
5
import * as React from 'react' ;
6
6
7
- import { disableBodyScroll , enableBodyScroll } from 'body-scroll-lock' ;
8
7
import {
9
8
Suspense ,
10
9
startTransition ,
@@ -13,18 +12,19 @@ import {
13
12
useRef ,
14
13
useState ,
15
14
} from 'react' ;
15
+ import { disableBodyScroll , enableBodyScroll } from 'body-scroll-lock' ;
16
16
17
- import cn from 'classnames ' ;
17
+ import { Feedback } from '../Feedback ' ;
18
18
import { IconClose } from 'components/Icon/IconClose' ;
19
19
import { IconHamburger } from 'components/Icon/IconHamburger' ;
20
20
import { IconSearch } from 'components/Icon/IconSearch' ;
21
- import { Search } from 'components/Search' ;
22
- import NextLink from 'next/link' ;
23
- import { useRouter } from 'next/router' ;
24
21
import { Logo } from '../../Logo' ;
25
- import { Feedback } from '../Feedback' ;
26
- import { SidebarRouteTree } from '../Sidebar/SidebarRouteTree' ;
22
+ import NextLink from 'next/link' ;
27
23
import 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' ;
28
28
29
29
declare global {
30
30
interface Window {
@@ -98,7 +98,7 @@ function Link({
98
98
return (
99
99
< NextLink
100
100
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"
102
102
{ ...props } >
103
103
{ children }
104
104
</ NextLink >
@@ -234,8 +234,8 @@ export default function TopNav({
234
234
'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' ,
235
235
{ 'dark:shadow-nav-dark shadow-nav' : isScrolled || isOpen }
236
236
) } >
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 " >
239
239
< button
240
240
type = "button"
241
241
aria-label = "Menu"
@@ -248,7 +248,7 @@ export default function TopNav({
248
248
) } >
249
249
{ isOpen ? < IconClose /> : < IconHamburger /> }
250
250
</ button >
251
- < div className = "3xl:flex-1 flex align-center" >
251
+ < div className = "flex 3xl:flex-1 align-center" >
252
252
< NextLink
253
253
href = "/"
254
254
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({
261
261
</ NextLink >
262
262
</ div >
263
263
</ 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" >
265
265
< button
266
266
type = "button"
267
267
className = { cn (
268
268
'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'
269
269
) }
270
270
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" />
272
272
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" >
274
274
< Kbd data-platform = "mac" > ⌘</ Kbd >
275
275
< Kbd data-platform = "win" wide >
276
276
Ctrl
@@ -302,9 +302,9 @@ export default function TopNav({
302
302
< button
303
303
aria-label = "Search"
304
304
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"
306
306
onClick = { onOpenSearch } >
307
- < IconSearch className = "align-middle w-5 h-5" />
307
+ < IconSearch className = "w-5 h-5 align-middle " />
308
308
</ button >
309
309
</ div >
310
310
< div className = "flex dark:hidden" >
@@ -314,7 +314,7 @@ export default function TopNav({
314
314
onClick = { ( ) => {
315
315
window . __setPreferredTheme ( 'dark' ) ;
316
316
} }
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" >
318
318
{ darkIcon }
319
319
</ button >
320
320
</ div >
@@ -325,7 +325,7 @@ export default function TopNav({
325
325
onClick = { ( ) => {
326
326
window . __setPreferredTheme ( 'light' ) ;
327
327
} }
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" >
329
329
{ lightIcon }
330
330
</ button >
331
331
</ div >
@@ -335,7 +335,7 @@ export default function TopNav({
335
335
target = "_blank"
336
336
rel = "noreferrer noopener"
337
337
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" >
339
339
{ githubIcon }
340
340
</ Link >
341
341
</ div >
@@ -350,13 +350,13 @@ export default function TopNav({
350
350
className = "overflow-y-scroll isolate no-bg-scrollbar lg:w-[342px] grow bg-wash dark:bg-wash-dark" >
351
351
< aside
352
352
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` ,
354
354
isOpen ? 'block z-40' : 'hidden lg:block'
355
355
) } >
356
356
< nav
357
357
role = "navigation"
358
358
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" >
360
360
{ /* No fallback UI so need to be careful not to suspend directly inside. */ }
361
361
< Suspense fallback = { null } >
362
362
< 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({
379
379
</ div >
380
380
< div
381
381
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"
383
383
/>
384
384
< SidebarRouteTree
385
385
// Don't share state between the desktop and mobile versions.
0 commit comments