@@ -31,12 +31,13 @@ module Toc = {
31
31
<ul className = "mt-3 py-1 mb-4 border-l border-fire-10" >
32
32
{Array .map (entries , ({header , href }) =>
33
33
<li key = header className = "pl-2 mt-2 first:mt-1" >
34
- // <Link
35
- // to=Url(href)
36
- // className="font-normal block text-14 text-gray-40 leading-tight hover:text-gray-80">
37
- // {//links, nested
38
- // React.string(header)}
39
- // </Link>
34
+ <Link .String
35
+ to = href
36
+ className = "font-normal block text-14 text-gray-40 leading-tight hover:text-gray-80"
37
+ >
38
+ {//links, nested
39
+ React .string (header )}
40
+ </Link .String >
40
41
</li >
41
42
)-> React .array }
42
43
</ul >
@@ -78,12 +79,13 @@ module Sidebar = {
78
79
}
79
80
80
81
<li key = m .name className = {hidden ++ " mt-1 leading-4" }>
81
- // <Link
82
- // to=Url(m.href)
83
- // className={"truncate block py-1 md:h-auto tracking-tight text-gray-60 rounded-sm hover:bg-gray-20 hover:-ml-2 hover:py-1 hover:pl-2 " ++
84
- // active}>
85
- // {React.string(m.name)}
86
- // </Link>
82
+ <Link
83
+ to = m .href
84
+ className = {"truncate block py-1 md:h-auto tracking-tight text-gray-60 rounded-sm hover:bg-gray-20 hover:-ml-2 hover:py-1 hover:pl-2 " ++
85
+ active }
86
+ >
87
+ {React .string (m .name )}
88
+ </Link >
87
89
{switch activeToc {
88
90
| Some ({entries }) =>
89
91
if Array .length (entries ) === 0 {
@@ -138,16 +140,19 @@ module Sidebar = {
138
140
id = "sidebar"
139
141
className = {(
140
142
isOpen ? "fixed w-full left-0 h-full z-20 min-w-320" : "hidden "
141
- ) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 h-auto md:relative overflow-y-visible bg-white mt-28 md:mt-0" }>
143
+ ) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 h-auto md:relative overflow-y-visible bg-white mt-28 md:mt-0" }
144
+ >
142
145
<aside
143
146
id = "sidebar-content"
144
- className = "relative top-0 px-4 w-full block md:pt-10 md:top-28 md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-auto max-h-[calc(100vh-7rem)]" >
147
+ className = "relative top-0 px-4 w-full block md:pt-10 md:top-28 md:sticky border-r border-gray-20 overflow-y-auto pb-24 h-auto max-h-[calc(100vh-7rem)]"
148
+ >
145
149
<button
146
150
onClick = {evt => {
147
151
ReactEvent .Mouse .preventDefault (evt )
148
152
toggle ()
149
153
}}
150
- className = "md:hidden h-16 flex pt-2 right-4 absolute" >
154
+ className = "md:hidden h-16 flex pt-2 right-4 absolute"
155
+ >
151
156
<Icon .Close />
152
157
</button >
153
158
<div className = "flex justify-between" >
@@ -182,8 +187,9 @@ module BreadCrumbs = {
182
187
let item = if i === List .length (crumbs ) - 1 {
183
188
<span key = {Int .toString (i )}> {React .string (crumb .name )} </span >
184
189
} else {
185
- React .null
186
- // <Link key={Int.toString(i)} to=Url(crumb.href)> {React.string(crumb.name)} </Link>
190
+ <Link .String key = {Int .toString (i )} to = crumb .href >
191
+ {React .string (crumb .name )}
192
+ </Link .String >
187
193
}
188
194
if i > 0 {
189
195
<span key = {Int .toString (i )}>
@@ -241,7 +247,7 @@ let make = (
241
247
}
242
248
243
249
React .useEffect (() => {
244
- // TODO: figure out how to watch for route changes
250
+ // TODO RR7 : figure out how to watch for route changes
245
251
// open Next.Router.Events
246
252
// let {Next.Router.events: events} = router
247
253
@@ -283,20 +289,22 @@ let make = (
283
289
| Some ({name , href }) =>
284
290
<Link
285
291
to = href
286
- className = {"flex items-center text-fire hover:text-fire-70 border-2 border-red-300 rounded py-1.5 px-3" }>
292
+ className = {"flex items-center text-fire hover:text-fire-70 border-2 border-red-300 rounded py-1.5 px-3" }
293
+ >
287
294
<Icon .ArrowRight className = {"rotate-180 mr-2" } />
288
295
{React .string (name )}
289
296
</Link >
290
297
| None => React .null
291
298
}
292
299
let next = switch items -> Array .get (i + 1 ) {
293
- | Some ({name , href }) => React .null
294
- // <Link
295
- // to=Url(href)
296
- // className={"flex items-center text-fire hover:text-fire-70 ml-auto border-2 border-red-300 rounded py-1.5 px-3"}>
297
- // {React.string(name)}
298
- // <Icon.ArrowRight className={"ml-2"} />
299
- // </Link>
300
+ | Some ({name , href }) =>
301
+ <Link
302
+ to = href
303
+ className = {"flex items-center text-fire hover:text-fire-70 ml-auto border-2 border-red-300 rounded py-1.5 px-3" }
304
+ >
305
+ {React .string (name )}
306
+ <Icon .ArrowRight className = {"ml-2" } />
307
+ </Link >
300
308
| None => React .null
301
309
}
302
310
<div className = {"flex justify-between mt-9" }>
@@ -309,7 +317,7 @@ let make = (
309
317
310
318
<>
311
319
<Meta title = metaTitle />
312
- <EnableCollapsibleNavbar isEnabled = {! isSidebarOpen && ! isNavOpen }>
320
+ <EnableCollapsibleNavbar isEnabled = {isSidebarOpen && isNavOpen }>
313
321
<div className = {"mt-16 min-w-320 " ++ theme }>
314
322
<div className = "w-full" >
315
323
<Navigation isOverlayOpen = isNavOpen setOverlayOpen = setNavOpen />
@@ -319,10 +327,12 @@ let make = (
319
327
<main className = "px-4 w-full pt-20 md:ml-12 lg:mr-8 mb-32 md:max-w-576 lg:max-w-740" >
320
328
//width of the right content part
321
329
<div
322
- className = {"z-10 fixed border-b shadow top-[112px] left-0 pl-4 bg-white w-full py-4 md:relative md:border-none md:shadow-none md:p-0 md:top-auto flex items-center transition duration-300 ease-out group-[.nav-disappear]:-translate-y-64 md:group-[.nav-disappear]:-translate-y-0" }>
330
+ className = {"z-10 fixed border-b shadow top-[112px] left-0 pl-4 bg-white w-full py-4 md:relative md:border-none md:shadow-none md:p-0 md:top-auto flex items-center transition duration-300 ease-out group-[.nav-disappear]:-translate-y-64 md:group-[.nav-disappear]:-translate-y-0" }
331
+ >
323
332
<MobileDrawerButton hidden = isNavOpen onClick = {handleDrawerButtonClick } />
324
333
<div
325
- className = "truncate overflow-x-auto touch-scroll flex items-center space-x-4 md:justify-between mr-4 w-full" >
334
+ className = "truncate overflow-x-auto touch-scroll flex items-center space-x-4 md:justify-between mr-4 w-full"
335
+ >
326
336
breadcrumbs
327
337
editLinkEl
328
338
</div >
0 commit comments