2015-05-13 16:26:12 +02:00
|
|
|
import React from 'react';
|
2015-10-02 11:03:42 +02:00
|
|
|
|
2016-02-05 10:38:59 +01:00
|
|
|
import AppBase from './app_base';
|
2016-01-11 14:00:09 +01:00
|
|
|
import AppRouteWrapper from './app_route_wrapper';
|
2016-01-11 12:54:15 +01:00
|
|
|
import Footer from './footer';
|
2016-02-05 10:38:59 +01:00
|
|
|
import Header from './header';
|
2016-01-11 12:54:15 +01:00
|
|
|
|
2015-05-18 18:00:12 +02:00
|
|
|
|
2016-06-06 18:52:05 +02:00
|
|
|
const AscribeApp = React.createClass({
|
2015-09-30 17:09:46 +02:00
|
|
|
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,
|
2016-01-11 12:54:15 +01:00
|
|
|
},
|
|
|
|
|
2015-05-18 18:00:12 +02:00
|
|
|
render() {
|
2016-06-07 14:53:48 +02:00
|
|
|
const { activeRoute, children, routes } = this.props;
|
2016-06-06 18:52:05 +02:00
|
|
|
const showFooter = activeRoute && activeRoute.footer;
|
2016-01-11 12:54:15 +01:00
|
|
|
|
2015-05-18 18:00:12 +02:00
|
|
|
return (
|
2016-02-05 14:22:42 +01:00
|
|
|
<div className="ascribe-app ascribe-default-app">
|
2016-06-07 14:53:48 +02:00
|
|
|
<Header routes={routes} />
|
|
|
|
<AppRouteWrapper>
|
2016-01-11 12:54:15 +01:00
|
|
|
{/* Routes are injected here */}
|
2016-01-11 14:00:09 +01:00
|
|
|
{children}
|
|
|
|
</AppRouteWrapper>
|
2016-06-06 18:52:05 +02:00
|
|
|
{showFooter ? <Footer /> : null}
|
2015-06-05 11:06:36 +02:00
|
|
|
</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);
|