2015-06-05 11:06:36 +02:00
|
|
|
'use strict';
|
|
|
|
|
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
|
|
|
|
2015-05-20 12:00:16 +02:00
|
|
|
let 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-02-05 10:38:59 +01:00
|
|
|
// Provided from AppBase
|
|
|
|
currentUser: React.PropTypes.object,
|
|
|
|
whitelabel: React.PropTypes.object
|
2016-01-11 12:54:15 +01:00
|
|
|
},
|
|
|
|
|
2015-05-18 18:00:12 +02:00
|
|
|
render() {
|
2016-02-05 10:38:59 +01:00
|
|
|
const { activeRoute, children, currentUser, routes, whitelabel } = this.props;
|
2016-03-04 15:53:55 +01:00
|
|
|
const Footer = 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-01-11 18:41:07 +01:00
|
|
|
<Header
|
|
|
|
currentUser={currentUser}
|
|
|
|
routes={routes}
|
|
|
|
whitelabel={whitelabel} />
|
2016-01-11 14:00:09 +01:00
|
|
|
<AppRouteWrapper
|
|
|
|
currentUser={currentUser}
|
|
|
|
whitelabel={whitelabel}>
|
2016-01-11 12:54:15 +01:00
|
|
|
{/* Routes are injected here */}
|
2016-01-11 14:00:09 +01:00
|
|
|
{children}
|
|
|
|
</AppRouteWrapper>
|
2016-03-04 15:53:55 +01:00
|
|
|
{Footer ? <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);
|