summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-core/src/lib/renderWithContext.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-10-08 18:19:49 +0200
committerSamy Pesse <samypesse@gmail.com>2016-10-08 18:19:49 +0200
commit03b89194d785807e12f3a7b40d5558d300e3cc49 (patch)
treebd63626c3186ce8699a473457127dd536bc0064a /packages/gitbook-core/src/lib/renderWithContext.js
parent68ec88c62096faf5c8538bec4431868919ae9652 (diff)
downloadgitbook-03b89194d785807e12f3a7b40d5558d300e3cc49.zip
gitbook-03b89194d785807e12f3a7b40d5558d300e3cc49.tar.gz
gitbook-03b89194d785807e12f3a7b40d5558d300e3cc49.tar.bz2
Prepare for multiple role rendering for ebooks
Diffstat (limited to 'packages/gitbook-core/src/lib/renderWithContext.js')
-rw-r--r--packages/gitbook-core/src/lib/renderWithContext.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/gitbook-core/src/lib/renderWithContext.js b/packages/gitbook-core/src/lib/renderWithContext.js
index 44f8ba4..f9a093c 100644
--- a/packages/gitbook-core/src/lib/renderWithContext.js
+++ b/packages/gitbook-core/src/lib/renderWithContext.js
@@ -9,7 +9,8 @@ const contextShape = require('../shapes/context');
const GitBookApplication = React.createClass({
propTypes: {
- context: contextShape
+ context: contextShape,
+ matching: React.PropTypes.object
},
componentDidMount() {
@@ -23,13 +24,13 @@ const GitBookApplication = React.createClass({
},
render() {
- const { context } = this.props;
+ const { context, matching } = this.props;
return (
<ContextProvider context={context}>
<PJAXWrapper>
<I18nProvider>
- <InjectedComponent matching={{ role: 'Body' }} />
+ <InjectedComponent matching={matching} />
</I18nProvider>
</PJAXWrapper>
</ContextProvider>
@@ -42,11 +43,12 @@ const GitBookApplication = React.createClass({
* Render the application for a GitBook context.
*
* @param {GitBookContext} context
+ * @param {Object} matching
* @return {React.Element} element
*/
-function renderWithContext(context) {
+function renderWithContext(context, matching) {
return (
- <GitBookApplication context={context} />
+ <GitBookApplication context={context} matching={matching} />
);
}