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

32 lines
915 B
JavaScript
Raw Permalink 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 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,
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired
},
2015-05-18 18:00:12 +02:00
render() {
const { activeRoute, children, routes } = this.props;
const RouteFooterType = activeRoute && activeRoute.footer;
2015-05-18 18:00:12 +02:00
return (
<div className="ascribe-app ascribe-default-app">
<Header routes={routes} />
<div className="container ascribe-body">
{/* Routes are injected here */}
{children}
</div>
{RouteFooterType ? <RouteFooterType /> : 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);