-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathpage.jsx
47 lines (40 loc) · 1.52 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
import React from 'react';
import Interactive from 'antwar-interactive';
import Container from '../container/container';
import Sidebar from '../sidebar/sidebar';
import Sidecar from '../sidecar/sidecar';
import Contributors from '../contributors/contributors';
import './page-style';
import '../sidebar/sidebar-style';
import { trimEnd } from 'lodash';
export default ({ section, page }) => {
let edit = page.edit || `https://github.com/angular-fullstack/generator-angular-fullstack/edit/master/docs/content/${trimEnd(page.url, '/')}${page.type === 'index' ? '/index' : ''}.md`;
return (
<Container className="page">
<Sidecar />
<Interactive
id="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>
<a className="page__edit" href={ edit }>
Edit this Page
<i className="icon-edit" />
</a>
<div dangerouslySetInnerHTML={{ __html: page.content }} />
<hr style={{ display: page.contributors.length ? 'block' : 'none' }} />
<h3 style={{ display: page.contributors.length ? 'block' : 'none' }}>Contributors</h3>
<Contributors contributors={ page.contributors } />
</section>
</Container>
);
};