2015-08-11 13:10:15 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import Header from '../../header';
|
2015-08-18 09:42:28 +02:00
|
|
|
import Footer from '../../footer';
|
|
|
|
|
2015-08-11 13:10:15 +02:00
|
|
|
import GlobalNotification from '../../global_notification';
|
|
|
|
|
2015-09-18 13:46:15 +02:00
|
|
|
import classNames from 'classnames';
|
|
|
|
|
2015-09-29 14:58:56 +02:00
|
|
|
import { getSubdomain } from '../../../utils/general_utils';
|
|
|
|
|
2015-08-25 16:33:26 +02:00
|
|
|
|
2015-08-11 13:10:15 +02:00
|
|
|
let WalletApp = 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,
|
|
|
|
routes: React.PropTypes.arrayOf(React.PropTypes.object)
|
|
|
|
},
|
2015-08-19 14:48:22 +02:00
|
|
|
|
2015-08-11 13:10:15 +02:00
|
|
|
render() {
|
2015-09-29 14:58:56 +02:00
|
|
|
let subdomain = getSubdomain();
|
2015-10-01 11:16:38 +02:00
|
|
|
|
|
|
|
// In react-router 1.0, Routes have no 'name' property anymore. To keep functionality however,
|
|
|
|
// we split the path by the first occurring slash and take the first splitter.
|
|
|
|
let activeRoutes = this.props.routes.map(elem => 'route--' + elem.path.split('/')[0]);
|
2015-08-25 16:33:26 +02:00
|
|
|
|
|
|
|
let header = null;
|
2015-10-01 14:34:46 +02:00
|
|
|
if ((this.props.history.isActive('/login') || this.props.history.isActive('/signup') || this.props.history.isActive('/contract_notifications'))
|
2015-08-19 17:18:32 +02:00
|
|
|
&& (['ikonotv', 'cyland']).indexOf(subdomain) > -1) {
|
2015-10-01 11:16:38 +02:00
|
|
|
header = (<div className="hero"/>);
|
2015-08-19 14:48:22 +02:00
|
|
|
} else {
|
2015-10-01 14:54:56 +02:00
|
|
|
header = <Header showAddWork={true} routes={this.props.routes} />;
|
2015-08-19 14:48:22 +02:00
|
|
|
}
|
2015-08-25 16:33:26 +02:00
|
|
|
|
2015-08-11 13:10:15 +02:00
|
|
|
return (
|
2015-09-21 16:23:18 +02:00
|
|
|
<div className={classNames('ascribe-wallet-app', activeRoutes)}>
|
2015-09-18 15:36:01 +02:00
|
|
|
<div className='container'>
|
|
|
|
{header}
|
2015-10-01 11:16:38 +02:00
|
|
|
{this.props.children}
|
2015-09-18 15:36:01 +02:00
|
|
|
<GlobalNotification />
|
|
|
|
<div id="modal" className="container"></div>
|
|
|
|
<Footer />
|
|
|
|
</div>
|
2015-08-11 13:10:15 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default WalletApp;
|