2015-07-10 16:43:35 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2015-08-11 14:47:28 +02:00
|
|
|
import Hero from './components/prize_hero';
|
2015-07-13 16:34:26 +02:00
|
|
|
import Header from '../../header';
|
2015-08-18 09:42:28 +02:00
|
|
|
import Footer from '../../footer';
|
2015-07-10 16:43:35 +02:00
|
|
|
import GlobalNotification from '../../global_notification';
|
|
|
|
|
2015-08-27 14:34:15 +02:00
|
|
|
import getRoutes from './prize_routes';
|
|
|
|
|
2015-09-29 14:58:56 +02:00
|
|
|
import { getSubdomain } from '../../../utils/general_utils';
|
|
|
|
|
|
|
|
|
2015-07-10 16:43:35 +02:00
|
|
|
let PrizeApp = React.createClass({
|
2015-10-01 11:16:38 +02:00
|
|
|
propTypes: {
|
|
|
|
children: React.PropTypes.oneOfType([
|
|
|
|
React.PropTypes.arrayOf(React.PropTypes.element),
|
|
|
|
React.PropTypes.element
|
|
|
|
]),
|
|
|
|
history: React.PropTypes.object
|
|
|
|
},
|
2015-07-13 16:34:26 +02:00
|
|
|
|
2015-07-10 16:43:35 +02:00
|
|
|
render() {
|
2015-07-13 16:34:26 +02:00
|
|
|
let header = null;
|
2015-09-29 14:58:56 +02:00
|
|
|
let subdomain = getSubdomain();
|
2015-08-27 14:34:15 +02:00
|
|
|
|
|
|
|
let ROUTES = getRoutes(null, subdomain);
|
|
|
|
|
2015-10-01 11:16:38 +02:00
|
|
|
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 {
|
2015-08-27 14:34:15 +02:00
|
|
|
header = <Header showAddWork={false} routes={ROUTES}/>;
|
2015-07-13 16:34:26 +02:00
|
|
|
}
|
|
|
|
|
2015-07-10 16:43:35 +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}
|
2015-10-01 11:16:38 +02:00
|
|
|
{this.props.children}
|
2015-07-10 16:43:35 +02:00
|
|
|
<GlobalNotification />
|
|
|
|
<div id="modal" className="container"></div>
|
2015-08-18 09:42:28 +02:00
|
|
|
<Footer />
|
2015-07-10 16:43:35 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default PrizeApp;
|