summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-theme-default/src/components/Page.js
blob: 8e4324c3a2af041a71961a71ac59bfebefadcfa5 (plain)
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
const GitBook = require('gitbook-core');
const { React } = GitBook;

const Page = React.createClass({
    propTypes: {
        page: GitBook.Shapes.Page
    },

    render() {
        const { page } = this.props;

        return (
            <div className="PageContainer">
                <GitBook.InjectedComponent matching={{ role: 'search:container:results' }} props={this.props}>
                    <div className="Page">
                        <GitBook.InjectedComponentSet matching={{ role: 'page:header' }} props={this.props} />

                        <GitBook.InjectedComponent matching={{ role: 'page:container' }} props={this.props}>
                            <GitBook.HTMLContent html={page.content} />
                        </GitBook.InjectedComponent>

                        <GitBook.InjectedComponentSet matching={{ role: 'page:footer' }} props={this.props} />
                    </div>
                </GitBook.InjectedComponent>
            </div>
        );
    }
});

module.exports = Page;