-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
Copy pathPage.jsx
72 lines (63 loc) · 1.82 KB
/
Page.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import React from 'react';
import Interactive from 'antwar-interactive';
import Container from '../Container/Container';
import Sidebar from '../Sidebar/Sidebar';
import PageLinks from '../PageLinks/PageLinks';
import Gitter from '../Gitter/Gitter';
import Contributors from '../Contributors/Contributors';
import Sponsors from '../Sponsors/Sponsors';
import './Page.scss';
import '../Sidebar/Sidebar.scss';
import '../Sponsors/Sponsors.scss';
import '../Gitter/Gitter.scss';
export default ({ section, page }) => (
<Container className="page">
<Sponsors />
<Interactive
id="src/components/Sidebar/Sidebar.jsx"
component={ Sidebar }
sectionName={ section.name }
pages={ section.pages().map(page => ({
url: page.url,
title: page.title,
anchors: page.anchors
})) }
currentPage={ page.url.replace('/index', '') } />
<section className="page__content">
<h1>{ page.title }</h1>
<PageLinks
page={ page }
section={ section.name } />
<div dangerouslySetInnerHTML={{
__html: page.content
}} />
{ page.related.length > 0 ? (
<div>
<hr />
<h3>Further Reading</h3>
<ul>
{
page.related.map((link, index) => (
<li key={ index }>
<a href={ link.url }>
{ link.title }
</a>
</li>
))
}
</ul>
</div>
) : null }
{ page.contributors.length > 0 ? (
<div>
<hr />
<h3>Contributors</h3>
<Contributors contributors={ page.contributors } />
</div>
) : null }
<Interactive
id="src/components/Gitter/Gitter.jsx"
component={ Gitter } />
</section>
</Container>
);