1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 09:50:31 +01:00
onion/js/components/ascribe_app.js

34 lines
968 B
JavaScript
Raw Normal View History

2015-05-13 16:26:12 +02:00
import React from 'react';
2016-02-05 10:38:59 +01:00
import AppBase from './app_base';
import AppRouteWrapper from './app_route_wrapper';
import Footer from './footer';
2016-02-05 10:38:59 +01:00
import Header from './header';
2015-05-18 18:00:12 +02:00
const AscribeApp = React.createClass({
propTypes: {
2016-02-05 10:38:59 +01:00
activeRoute: React.PropTypes.object.isRequired,
children: React.PropTypes.element.isRequired,
2016-01-12 15:05:00 +01:00
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
},
2015-05-18 18:00:12 +02:00
render() {
const { activeRoute, children, routes } = this.props;
const showFooter = activeRoute && activeRoute.footer;
2015-05-18 18:00:12 +02:00
return (
<div className="ascribe-app ascribe-default-app">
<Header routes={routes} />
<AppRouteWrapper>
{/* Routes are injected here */}
{children}
</AppRouteWrapper>
{showFooter ? <Footer /> : null}
</div>
2015-05-18 18:00:12 +02:00
);
}
2015-05-20 12:00:16 +02:00
});
2015-05-13 16:26:12 +02:00
2016-02-05 10:38:59 +01:00
export default AppBase(AscribeApp);