mirror of
https://github.com/ascribe/onion.git
synced 2025-02-14 21:10:27 +01:00
Now that currentUser and whitelabel are passed as context, we don’t need AppRouteWrapper to copy them into routes as props
33 lines
928 B
JavaScript
33 lines
928 B
JavaScript
import React from 'react';
|
|
|
|
import AppBase from './app_base';
|
|
import Footer from './footer';
|
|
import Header from './header';
|
|
|
|
|
|
const AscribeApp = React.createClass({
|
|
propTypes: {
|
|
activeRoute: React.PropTypes.object.isRequired,
|
|
children: React.PropTypes.element.isRequired,
|
|
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
|
|
},
|
|
|
|
render() {
|
|
const { activeRoute, children, routes } = this.props;
|
|
const showFooter = activeRoute && activeRoute.footer;
|
|
|
|
return (
|
|
<div className="ascribe-app ascribe-default-app">
|
|
<Header routes={routes} />
|
|
<div className="container ascribe-body">
|
|
{/* Routes are injected here */}
|
|
{children}
|
|
</div>
|
|
{showFooter ? <Footer /> : null}
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
export default AppBase(AscribeApp);
|