@@ -5,10 +5,11 @@ import React, { Component, useState, useEffect } from "react";
5
5
import { Link , NavLink , Redirect , Route , Switch } from "react-router-dom" ;
6
6
import Media from "react-media" ;
7
7
import Loadable from "react-loadable" ;
8
- import changeCase from "change-case" ;
8
+ import { paramCase } from "change-case" ;
9
9
10
10
import { colors , colorNames } from "purs/Lumi.Components.Color" ;
11
11
import { column , column_ } from "purs/Lumi.Components.Column" ;
12
+ import { divider_ } from "purs/Lumi.Components.Divider" ;
12
13
import { row , row_ } from "purs/Lumi.Components.Row" ;
13
14
import {
14
15
text ,
@@ -47,7 +48,7 @@ const fromComponentPath = title => ({
47
48
loading : ( ) => null // these load quickly enough that a noisy loader makes it look slower
48
49
} ) ,
49
50
title,
50
- path : `/${ changeCase . hyphen ( title ) } ` ,
51
+ path : `/${ paramCase ( title ) } ` ,
51
52
componentSource : `${ repoSourceBasePath } /src/Lumi/Components/${ title } .purs` ,
52
53
exampleSource : `${ repoSourceBasePath } /docs/Examples/${ title } .example.purs` ,
53
54
apiReference : `${ pursuitBasePath } /docs/Lumi.Components.${ title } `
@@ -64,7 +65,7 @@ const fromComponentPathv2 = title => ({
64
65
loading : ( ) => null // these load quickly enough that a noisy loader makes it look slower
65
66
} ) ,
66
67
title,
67
- path : `/v2/${ changeCase . hyphen ( title ) } ` ,
68
+ path : `/v2/${ paramCase ( title ) } ` ,
68
69
componentSource : `${ repoSourceBasePath } /src/Lumi/Components2/${ title } .purs` ,
69
70
exampleSource : `${ repoSourceBasePath } /docs/Examples2/${ title } .example.purs` ,
70
71
apiReference : `${ pursuitBasePath } /docs/Lumi.Components2.${ title } `
@@ -212,24 +213,16 @@ const renderRoute = component => (
212
213
render = { ( ) =>
213
214
column_ ( [
214
215
row ( {
215
- style : {
216
- alignItems : "center" ,
217
- marginBottom : "24px" ,
218
- flexWrap : "wrap"
219
- } ,
216
+ style : { alignItems : "baseline" , flexWrap : "wrap" } ,
220
217
children : [
221
- h1_ ( component . title ) ,
222
218
< a
223
219
className = "lumi"
224
220
target = "_blank"
225
221
rel = "noopener noreferrer"
226
222
href = { component . componentSource }
227
- style = { {
228
- marginLeft : "8px" ,
229
- marginRight : "8px"
230
- } }
223
+ style = { { marginRight : "8px" } }
231
224
>
232
- Component Source
225
+ { body_ ( " Component Source" ) }
233
226
</ a > ,
234
227
"|" ,
235
228
< a
@@ -242,7 +235,7 @@ const renderRoute = component => (
242
235
marginRight : "8px"
243
236
} }
244
237
>
245
- Example Source
238
+ { body_ ( " Example Source" ) }
246
239
</ a > ,
247
240
"|" ,
248
241
< a
@@ -254,7 +247,7 @@ const renderRoute = component => (
254
247
marginLeft : "8px"
255
248
} }
256
249
>
257
- API Reference
250
+ { body_ ( " API Reference" ) }
258
251
</ a > ,
259
252
< div
260
253
style = { {
@@ -271,6 +264,9 @@ const renderRoute = component => (
271
264
</ div >
272
265
]
273
266
} ) ,
267
+ divider_ ,
268
+ < div style = { { height : 20 } } /> ,
269
+ h1_ ( component . title ) ,
274
270
< component . docs />
275
271
] )
276
272
}
@@ -329,7 +325,7 @@ const Header = ({ isMobile, toggleMenu }) =>
329
325
style : {
330
326
position : "fixed" ,
331
327
top : 0 ,
332
- zIndex : 1 ,
328
+ zIndex : 100 ,
333
329
height : 60 ,
334
330
width : "100%" ,
335
331
justifyContent : "center" ,
@@ -424,15 +420,15 @@ const ExampleArea = ({ children }) =>
424
420
children,
425
421
style : {
426
422
width : "100%" ,
427
- padding : "20px"
423
+ padding : "0 20px 40px "
428
424
}
429
425
} ) ;
430
426
431
427
class ErrorBoundary extends Component {
432
428
state = { error : null } ;
433
429
434
- componentWillReceiveProps ( ) {
435
- this . setState ( { error : null } ) ;
430
+ static getDerivedStateFromProps ( ) {
431
+ return { error : null } ;
436
432
}
437
433
438
434
componentDidCatch ( error , info ) {
0 commit comments