@@ -5,10 +5,11 @@ import React, { Component, useState, useEffect } from "react";
55import { Link , NavLink , Redirect , Route , Switch } from "react-router-dom" ;
66import Media from "react-media" ;
77import Loadable from "react-loadable" ;
8- import changeCase from "change-case" ;
8+ import { paramCase } from "change-case" ;
99
1010import { colors , colorNames } from "purs/Lumi.Components.Color" ;
1111import { column , column_ } from "purs/Lumi.Components.Column" ;
12+ import { divider_ } from "purs/Lumi.Components.Divider" ;
1213import { row , row_ } from "purs/Lumi.Components.Row" ;
1314import {
1415 text ,
@@ -47,7 +48,7 @@ const fromComponentPath = title => ({
4748 loading : ( ) => null // these load quickly enough that a noisy loader makes it look slower
4849 } ) ,
4950 title,
50- path : `/${ changeCase . hyphen ( title ) } ` ,
51+ path : `/${ paramCase ( title ) } ` ,
5152 componentSource : `${ repoSourceBasePath } /src/Lumi/Components/${ title } .purs` ,
5253 exampleSource : `${ repoSourceBasePath } /docs/Examples/${ title } .example.purs` ,
5354 apiReference : `${ pursuitBasePath } /docs/Lumi.Components.${ title } `
@@ -64,7 +65,7 @@ const fromComponentPathv2 = title => ({
6465 loading : ( ) => null // these load quickly enough that a noisy loader makes it look slower
6566 } ) ,
6667 title,
67- path : `/v2/${ changeCase . hyphen ( title ) } ` ,
68+ path : `/v2/${ paramCase ( title ) } ` ,
6869 componentSource : `${ repoSourceBasePath } /src/Lumi/Components2/${ title } .purs` ,
6970 exampleSource : `${ repoSourceBasePath } /docs/Examples2/${ title } .example.purs` ,
7071 apiReference : `${ pursuitBasePath } /docs/Lumi.Components2.${ title } `
@@ -212,24 +213,16 @@ const renderRoute = component => (
212213 render = { ( ) =>
213214 column_ ( [
214215 row ( {
215- style : {
216- alignItems : "center" ,
217- marginBottom : "24px" ,
218- flexWrap : "wrap"
219- } ,
216+ style : { alignItems : "baseline" , flexWrap : "wrap" } ,
220217 children : [
221- h1_ ( component . title ) ,
222218 < a
223219 className = "lumi"
224220 target = "_blank"
225221 rel = "noopener noreferrer"
226222 href = { component . componentSource }
227- style = { {
228- marginLeft : "8px" ,
229- marginRight : "8px"
230- } }
223+ style = { { marginRight : "8px" } }
231224 >
232- Component Source
225+ { body_ ( " Component Source" ) }
233226 </ a > ,
234227 "|" ,
235228 < a
@@ -242,7 +235,7 @@ const renderRoute = component => (
242235 marginRight : "8px"
243236 } }
244237 >
245- Example Source
238+ { body_ ( " Example Source" ) }
246239 </ a > ,
247240 "|" ,
248241 < a
@@ -254,7 +247,7 @@ const renderRoute = component => (
254247 marginLeft : "8px"
255248 } }
256249 >
257- API Reference
250+ { body_ ( " API Reference" ) }
258251 </ a > ,
259252 < div
260253 style = { {
@@ -271,6 +264,9 @@ const renderRoute = component => (
271264 </ div >
272265 ]
273266 } ) ,
267+ divider_ ,
268+ < div style = { { height : 20 } } /> ,
269+ h1_ ( component . title ) ,
274270 < component . docs />
275271 ] )
276272 }
@@ -329,7 +325,7 @@ const Header = ({ isMobile, toggleMenu }) =>
329325 style : {
330326 position : "fixed" ,
331327 top : 0 ,
332- zIndex : 1 ,
328+ zIndex : 100 ,
333329 height : 60 ,
334330 width : "100%" ,
335331 justifyContent : "center" ,
@@ -424,15 +420,15 @@ const ExampleArea = ({ children }) =>
424420 children,
425421 style : {
426422 width : "100%" ,
427- padding : "20px"
423+ padding : "0 20px 40px "
428424 }
429425 } ) ;
430426
431427class ErrorBoundary extends Component {
432428 state = { error : null } ;
433429
434- componentWillReceiveProps ( ) {
435- this . setState ( { error : null } ) ;
430+ static getDerivedStateFromProps ( ) {
431+ return { error : null } ;
436432 }
437433
438434 componentDidCatch ( error , info ) {
0 commit comments