1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00
onion/js/components/ascribe_app.js
Brett Sun 2aa3aa5ff7 Fix Footer rendering from route declarations
Also a few cosmetic changes to make it more obvious the route holds an
actual footer type.
2016-06-10 10:25:09 +02:00

32 lines
915 B
JavaScript

import React from 'react';
import AppBase from './app_base';
import Header from './header';
const AscribeApp = React.createClass({
propTypes: {
activeRoute: React.PropTypes.object.isRequired,
children: React.PropTypes.element.isRequired,
routes: React.PropTypes.arrayOf(React.PropTypes.object).isRequired
},
render() {
const { activeRoute, children, routes } = this.props;
const RouteFooterType = activeRoute && activeRoute.footer;
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>
);
}
});
export default AppBase(AscribeApp);