summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-theme-default/src/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/gitbook-plugin-theme-default/src/index.js')
-rw-r--r--packages/gitbook-plugin-theme-default/src/index.js23
1 files changed, 19 insertions, 4 deletions
diff --git a/packages/gitbook-plugin-theme-default/src/index.js b/packages/gitbook-plugin-theme-default/src/index.js
index 3630bbe..f85e6bc 100644
--- a/packages/gitbook-plugin-theme-default/src/index.js
+++ b/packages/gitbook-plugin-theme-default/src/index.js
@@ -1,21 +1,36 @@
const React = require('react');
const GitBook = require('gitbook-core');
-const ThemeBody = React.createClass({
+const Sidebar = require('./Sidebar');
+const Page = require('./Page');
+
+let ThemeBody = React.createClass({
+ propTypes: {
+ page: GitBook.Shapes.Page
+ },
+
render() {
+ const { page } = this.props;
+
+ console.log('render theme', page);
return (
- <div>
+ <div className="GitBook book">
<GitBook.Head
- title={'Homepage'}
+ title={page.title}
titleTemplate="%s - GitBook"
/>
- My Base theme for gitbook
+ <Sidebar />
+ <Page page={page} />
</div>
);
}
});
+ThemeBody = GitBook.connect(ThemeBody, ({page}) => {
+ return { page };
+});
+
module.exports = GitBook.createPlugin((dispatch, state) => {
dispatch(GitBook.registerComponent(ThemeBody, { role: 'Body' }));
});