@@ -31,12 +31,13 @@ module Toc = {
3131 <ul className = "mt-3 py-1 mb-4 border-l border-fire-10" >
3232 {Array .map (entries , ({header , href }) =>
3333 <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 >
4041 </li >
4142 )-> React .array }
4243 </ul >
@@ -78,12 +79,13 @@ module Sidebar = {
7879 }
7980
8081 <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 >
8789 {switch activeToc {
8890 | Some ({entries }) =>
8991 if Array .length (entries ) === 0 {
@@ -138,16 +140,19 @@ module Sidebar = {
138140 id = "sidebar"
139141 className = {(
140142 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+ >
142145 <aside
143146 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+ >
145149 <button
146150 onClick = {evt => {
147151 ReactEvent .Mouse .preventDefault (evt )
148152 toggle ()
149153 }}
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+ >
151156 <Icon .Close />
152157 </button >
153158 <div className = "flex justify-between" >
@@ -182,8 +187,9 @@ module BreadCrumbs = {
182187 let item = if i === List .length (crumbs ) - 1 {
183188 <span key = {Int .toString (i )}> {React .string (crumb .name )} </span >
184189 } 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 >
187193 }
188194 if i > 0 {
189195 <span key = {Int .toString (i )}>
@@ -241,7 +247,7 @@ let make = (
241247 }
242248
243249 React .useEffect (() => {
244- // TODO: figure out how to watch for route changes
250+ // TODO RR7 : figure out how to watch for route changes
245251 // open Next.Router.Events
246252 // let {Next.Router.events: events} = router
247253
@@ -283,20 +289,22 @@ let make = (
283289 | Some ({name , href }) =>
284290 <Link
285291 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+ >
287294 <Icon .ArrowRight className = {"rotate-180 mr-2" } />
288295 {React .string (name )}
289296 </Link >
290297 | None => React .null
291298 }
292299 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 >
300308 | None => React .null
301309 }
302310 <div className = {"flex justify-between mt-9" }>
@@ -309,7 +317,7 @@ let make = (
309317
310318 <>
311319 <Meta title = metaTitle />
312- <EnableCollapsibleNavbar isEnabled = {! isSidebarOpen && ! isNavOpen }>
320+ <EnableCollapsibleNavbar isEnabled = {isSidebarOpen && isNavOpen }>
313321 <div className = {"mt-16 min-w-320 " ++ theme }>
314322 <div className = "w-full" >
315323 <Navigation isOverlayOpen = isNavOpen setOverlayOpen = setNavOpen />
@@ -319,10 +327,12 @@ let make = (
319327 <main className = "px-4 w-full pt-20 md:ml-12 lg:mr-8 mb-32 md:max-w-576 lg:max-w-740" >
320328 //width of the right content part
321329 <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+ >
323332 <MobileDrawerButton hidden = isNavOpen onClick = {handleDrawerButtonClick } />
324333 <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+ >
326336 breadcrumbs
327337 editLinkEl
328338 </div >
0 commit comments