1
0
mirror of https://github.com/ascribe/onion.git synced 2024-11-15 09:35:10 +01:00
onion/js/components/whitelabel/wallet/wallet_app.js

51 lines
1.4 KiB
JavaScript
Raw Normal View History

'use strict';
import React from 'react';
import Router from 'react-router';
import Header from '../../header';
import Footer from '../../footer';
import GlobalNotification from '../../global_notification';
import getRoutes from './wallet_routes';
2015-09-18 13:46:15 +02:00
import classNames from 'classnames';
import { getSubdomain } from '../../../utils/general_utils';
let RouteHandler = Router.RouteHandler;
2015-09-18 13:46:15 +02:00
let WalletApp = React.createClass({
2015-08-19 14:48:22 +02:00
mixins: [Router.State],
render() {
let subdomain = getSubdomain();
let ROUTES = getRoutes(null, subdomain);
2015-09-18 14:25:31 +02:00
let activeRoutes = this.getRoutes().map(elem => 'route--' + elem.name);
let header = null;
if ((this.isActive('landing') || this.isActive('login') || this.isActive('signup') || this.isActive('contract_notifications'))
&& (['ikonotv', 'cyland']).indexOf(subdomain) > -1) {
2015-08-19 14:48:22 +02:00
header = (
<div className="hero"/>);
} else {
header = <Header showAddWork={true} routes={ROUTES} />;
2015-08-19 14:48:22 +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}
<RouteHandler />
<GlobalNotification />
<div id="modal" className="container"></div>
<Footer />
</div>
</div>
);
}
});
export default WalletApp;