@@ -11,62 +11,71 @@ import '../sidebar/sidebar-style';
11
11
import '../sponsors/sponsors-style' ;
12
12
import '../gitter/gitter-style' ;
13
13
14
- export default ( { section, page } ) => (
15
- < Container className = "page" >
14
+ const Page = ( { page, section } ) => {
15
+ const {
16
+ file : {
17
+ attributes : {
18
+ anchors,
19
+ contributors,
20
+ title,
21
+ related,
22
+ } ,
23
+ body
24
+ } ,
25
+ url,
26
+ } = page ;
16
27
17
- < Sponsors />
28
+ return (
29
+ < Container className = "page" >
30
+ < Sponsors />
31
+ < Interactive
32
+ id = "components/sidebar/sidebar.jsx"
33
+ component = { Sidebar }
34
+ sectionName = { section . name }
35
+ pages = { section . pages ( ) . map ( page => ( { url, title, anchors } ) ) }
36
+ currentPage = { url } />
18
37
19
- < Interactive
20
- id = "components/sidebar/sidebar.jsx"
21
- component = { Sidebar }
22
- sectionName = { section . name }
23
- pages = { section . pages ( ) . map ( page => ( {
24
- url : page . url ,
25
- title : page . title ,
26
- anchors : page . anchors
27
- } ) ) }
28
- currentPage = { page . url . replace ( '/index' , '' ) } />
38
+ < section className = "page__content" >
39
+ < h1 > { title } </ h1 >
29
40
30
- < section className = "page__content" >
31
- < h1 > { page . title } </ h1 >
41
+ < PageLinks
42
+ page = { page }
43
+ section = { section . name } />
32
44
33
- < PageLinks
34
- page = { page }
35
- section = { section . name } />
45
+ < div dangerouslySetInnerHTML = { { __html : body } } />
36
46
37
- < div dangerouslySetInnerHTML = { {
38
- __html : page . content
39
- } } />
47
+ { related . length > 0 && (
48
+ < div >
49
+ < hr />
50
+ < h3 > Further Reading</ h3 >
51
+ < ul >
52
+ {
53
+ related . map ( ( link , index ) => (
54
+ < li key = { index } >
55
+ < a href = { link . url } >
56
+ { link . title }
57
+ </ a >
58
+ </ li >
59
+ ) )
60
+ }
61
+ </ ul >
62
+ </ div >
63
+ ) }
40
64
41
- { page . related . length > 0 ? (
42
- < div >
43
- < hr />
44
- < h3 > Further Reading</ h3 >
45
- < ul >
46
- {
47
- page . related . map ( ( link , index ) => (
48
- < li key = { index } >
49
- < a href = { link . url } >
50
- { link . title }
51
- </ a >
52
- </ li >
53
- ) )
54
- }
55
- </ ul >
56
- </ div >
57
- ) : null }
65
+ { contributors . length > 0 && (
66
+ < div >
67
+ < hr />
68
+ < h3 > Contributors</ h3 >
69
+ < Contributors contributors = { contributors } />
70
+ </ div >
71
+ ) }
58
72
59
- { page . contributors . length > 0 ? (
60
- < div >
61
- < hr />
62
- < h3 > Contributors </ h3 >
63
- < Contributors contributors = { page . contributors } / >
64
- </ div >
65
- ) : null }
73
+ < Interactive
74
+ id = "components/gitter/gitter.jsx"
75
+ component = { Gitter } />
76
+ </ section >
77
+ </ Container >
78
+ ) ;
79
+ } ;
66
80
67
- < Interactive
68
- id = "components/gitter/gitter.jsx"
69
- component = { Gitter } />
70
- </ section >
71
- </ Container >
72
- ) ;
81
+ export default Page ;
0 commit comments