1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 17:45:10 +01:00
onion/js/components/whitelabel/prize/prize_app.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

'use strict';
import React from 'react';
import Hero from './components/prize_hero';
2015-07-13 16:34:26 +02:00
import Header from '../../header';
import Footer from '../../footer';
import GlobalNotification from '../../global_notification';
import { getSubdomain } from '../../../utils/general_utils';
let PrizeApp = React.createClass({
propTypes: {
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element
]),
history: React.PropTypes.object,
routes: React.PropTypes.arrayOf(React.PropTypes.object)
},
2015-07-13 16:34:26 +02:00
render() {
2015-07-13 16:34:26 +02:00
let header = null;
let subdomain = getSubdomain();
if (this.props.history.isActive('/') || this.props.history.isActive('/login') || this.props.history.isActive('/signup')) {
2015-07-14 18:55:34 +02:00
header = <Hero />;
} else {
header = <Header showAddWork={false} routes={this.props.routes}/>;
2015-07-13 16:34:26 +02:00
}
return (
2015-09-18 13:46:15 +02:00
<div className={'container ascribe-prize-app client--' + subdomain}>
2015-07-13 16:34:26 +02:00
{header}
{this.props.children}
<GlobalNotification />
<div id="modal" className="container"></div>
<Footer />
</div>
);
}
});
export default PrizeApp;