mirror of
https://github.com/ascribe/onion.git
synced 2024-12-23 01:39:36 +01:00
40894cfea6
Simplifies testing so we can just look for a single class throughout all the apps when ensuring React has loaded our app
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
import React from 'react';
|
|
|
|
import AppBase from './app_base';
|
|
import AppRouteWrapper from './app_route_wrapper';
|
|
import Footer from './footer';
|
|
import Header from './header';
|
|
|
|
|
|
let AscribeApp = React.createClass({
|
|
propTypes: {
|
|
activeRoute: React.PropTypes.object.isRequired,
|
|
children: React.PropTypes.element.isRequired,
|
|
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired,
|
|
|
|
// Provided from AppBase
|
|
currentUser: React.PropTypes.object,
|
|
whitelabel: React.PropTypes.object
|
|
},
|
|
|
|
render() {
|
|
const { activeRoute, children, currentUser, routes, whitelabel } = this.props;
|
|
|
|
return (
|
|
<div className="ascribe-app ascribe-default-app">
|
|
<Header
|
|
currentUser={currentUser}
|
|
routes={routes}
|
|
whitelabel={whitelabel} />
|
|
<AppRouteWrapper
|
|
currentUser={currentUser}
|
|
whitelabel={whitelabel}>
|
|
{/* Routes are injected here */}
|
|
{children}
|
|
</AppRouteWrapper>
|
|
<Footer activeRoute={activeRoute} />
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
export default AppBase(AscribeApp);
|