1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 05:31:58 +02:00
onion/js/components/whitelabel/wallet/wallet_app.js

47 lines
1.3 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';
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 = window.location.host.split('.')[0];
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'))
&& (['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-18 14:25:31 +02:00
<div className={classNames('container', 'ascribe-wallet-app', 'client--' + subdomain, activeRoutes)}>
2015-08-19 14:48:22 +02:00
{header}
2015-08-12 16:26:24 +02:00
<RouteHandler />
<GlobalNotification />
<div id="modal" className="container"></div>
<Footer />
</div>
);
}
});
export default WalletApp;