@@ -32,9 +32,9 @@ module Toc = {
32
32
{Belt .Array .map (entries , ({header , href }) =>
33
33
<li key = header className = "pl-2 mt-3 first:mt-1" >
34
34
<Link href >
35
- <a
36
- className = "font-medium block text-sm text-gray-40 leading-tight hover:text-gray-80" > //links, nested
37
- { React .string (header )}
35
+ <a className = "font-medium block text-sm text-gray-40 leading-tight hover:text-gray-80" >
36
+ { //links, nested
37
+ React .string (header )}
38
38
</a >
39
39
</Link >
40
40
</li >
@@ -64,7 +64,9 @@ module Sidebar = {
64
64
~isItemActive : t => bool = _nav => false ,
65
65
~isHidden = false ,
66
66
~items : array <t >,
67
- ) => <ul className = "mt-2 text-14 font-medium" > {Belt .Array .map (items , m => {
67
+ ) =>
68
+ <ul className = "mt-2 text-14 font-medium" >
69
+ {Belt .Array .map (items , m => {
68
70
let hidden = isHidden ? "hidden" : "block"
69
71
let active = isItemActive (m )
70
72
? j ` bg-fire-10 text-fire leading-5 -ml-2 pl-2 font-medium block hover:bg-fire-10 `
@@ -93,7 +95,8 @@ module Sidebar = {
93
95
| None => React .null
94
96
}}
95
97
</li >
96
- })-> React .array } </ul >
98
+ })-> React .array }
99
+ </ul >
97
100
}
98
101
99
102
module Category = {
@@ -136,8 +139,7 @@ module Sidebar = {
136
139
id = "sidebar"
137
140
className = {(
138
141
isOpen ? "fixed w-full left-0 h-full z-20 min-w-320" : "hidden "
139
- ) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white md:relative" }
140
- style = {ReactDOMStyle .make (~minWidth = "12.9375rem" , ())}>
142
+ ) ++ " md:block md:w-48 md:-ml-4 lg:w-1/5 md:h-auto md:relative overflow-y-visible bg-white md:relative" }>
141
143
<aside
142
144
id = "sidebar-content"
143
145
className = "relative top-0 px-4 w-full block md:top-18 md:pt-24 md:sticky border-r border-gray-5 overflow-y-auto scrolling-touch pb-24"
@@ -179,14 +181,18 @@ module BreadCrumbs = {
179
181
let item = if i === Belt .List .length (crumbs ) - 1 {
180
182
<span key = {Belt .Int .toString (i )}> {React .string (crumb .name )} </span >
181
183
} else {
182
- <Link key = {Belt .Int .toString (i )} href = crumb .href > <a > {React .string (crumb .name )} </a > </Link >
184
+ <Link key = {Belt .Int .toString (i )} href = crumb .href >
185
+ <a > {React .string (crumb .name )} </a >
186
+ </Link >
183
187
}
184
188
if i > 0 {
185
189
<span key = {Belt .Int .toString (i )}> {React .string (" / " )} item </span >
186
190
} else {
187
191
item
188
192
}
189
- })-> Belt .List .toArray -> React .array }
193
+ })
194
+ -> Belt .List .toArray
195
+ -> React .array }
190
196
</div >
191
197
}
192
198
@@ -244,7 +250,14 @@ let make = (
244
250
}, [])
245
251
246
252
let editLinkEl = switch editHref {
247
- | Some (href ) => <a href className = "inline text-14 hover:underline text-fire" target = "_blank" rel = "noopener noreferrer" > {React .string ("Edit" )} </a >
253
+ | Some (href ) =>
254
+ <a
255
+ href
256
+ className = "inline text-14 hover:underline text-fire"
257
+ target = "_blank"
258
+ rel = "noopener noreferrer" >
259
+ {React .string ("Edit" )}
260
+ </a >
248
261
| None => React .null
249
262
}
250
263
@@ -253,30 +266,30 @@ let make = (
253
266
<div className = {"mt-16 min-w-320 " ++ theme }>
254
267
<div className = "w-full" >
255
268
<Navigation overlayState = (isNavOpen , setNavOpen ) />
256
- <div className = "flex justify-center" >
257
- <div className = "w-full max-w-1280 md:mx-8" >
258
- <div className = "flex" >
259
- sidebar
260
- <main
261
- className = "px-4 w-full pt-16 md:ml-12 md:mx-8 md:mt-2 md:pt-24 mb-32 max-w-740" > //width of the right content part
269
+ <div className = "flex lg:justify-center" >
270
+ <div className = "flex w-full max-w-1280 md:mx-8" >
271
+ sidebar
272
+ <main
273
+ className = "px-4 w-full pt-16 md:ml-12 lg:mr-8 md:mt-2 md:pt-24 mb-32 md:max-w-576 lg:max-w-740" >
274
+ //width of the right content part
275
+ <div
276
+ className = "z-10 fixed border-b shadow top-18 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" >
277
+ <MobileDrawerButton
278
+ hidden = isNavOpen
279
+ onClick = {evt => {
280
+ ReactEvent .Mouse .preventDefault (evt )
281
+ toggleSidebar ()
282
+ }}
283
+ />
262
284
<div
263
- className = "z-10 fixed border-b shadow top-18 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" >
264
- <MobileDrawerButton
265
- hidden = isNavOpen
266
- onClick = {evt => {
267
- ReactEvent .Mouse .preventDefault (evt )
268
- toggleSidebar ()
269
- }}
270
- />
271
- <div className = "truncate overflow-x-auto touch-scroll flex items-center space-x-4 md:justify-between mr-4 w-full" >
272
- breadcrumbs editLinkEl
273
- </div >
274
- </div >
275
- <div className = {hasBreadcrumbs ? "mt-10" : "-mt-4" }>
276
- <Mdx .Provider components > children </Mdx .Provider >
285
+ className = "truncate overflow-x-auto touch-scroll flex items-center space-x-4 md:justify-between mr-4 w-full" >
286
+ breadcrumbs editLinkEl
277
287
</div >
278
- </main >
279
- </div >
288
+ </div >
289
+ <div className = {hasBreadcrumbs ? "mt-10" : "-mt-4" }>
290
+ <Mdx .Provider components > children </Mdx .Provider >
291
+ </div >
292
+ </main >
280
293
</div >
281
294
</div >
282
295
</div >
0 commit comments