diff --git a/js/components/ascribe_app.js b/js/components/ascribe_app.js
index b4a894a3..789399b0 100644
--- a/js/components/ascribe_app.js
+++ b/js/components/ascribe_app.js
@@ -6,15 +6,16 @@ import Header from '../components/header';
import Footer from '../components/footer';
import GlobalNotification from './global_notification';
-// let Link = Router.Link;
-let RouteHandler = Router.RouteHandler;
+import getRoutes from '../routes';
+let RouteHandler = Router.RouteHandler;
+
let AscribeApp = React.createClass({
render() {
return (
-
+
diff --git a/js/components/header.js b/js/components/header.js
index 6c2dfac8..4cd8e4b0 100644
--- a/js/components/header.js
+++ b/js/components/header.js
@@ -93,8 +93,6 @@ let Header = React.createClass({
render() {
let account = null;
let signup = null;
- let collection = null;
- let addNewWork = null;
if (this.state.currentUser.username){
account = (
@@ -103,9 +101,6 @@ let Header = React.createClass({
{getLangText('Log out')}
);
-
- collection = {getLangText('COLLECTION')};
- addNewWork = this.props.showAddWork ? + {getLangText('NEW WORK')} : null;
}
else {
account = {getLangText('LOGIN')};
@@ -126,8 +121,6 @@ let Header = React.createClass({
diff --git a/js/components/nav_routes_links.js b/js/components/nav_routes_links.js
index 0e03e0fe..9a266ba8 100644
--- a/js/components/nav_routes_links.js
+++ b/js/components/nav_routes_links.js
@@ -16,6 +16,9 @@ let NavRoutesLinks = React.createClass({
},
extractLinksFromRoutes(node, i) {
+ if(!node) {
+ return;
+ }
node = node.props;
@@ -35,11 +38,11 @@ let NavRoutesLinks = React.createClass({
// if the node's child is actually a node of level one (a child of a node), we're
// returning a DropdownButton matching MenuItemLink
return (
- {child.props.headerTitle}
+ {child.props.headerTitle}
);
} else if(i === 0) {
return (
- {child.props.headerTitle}
+ {child.props.headerTitle}
);
} else {
return null;
diff --git a/js/components/routes.js b/js/components/routes.js
deleted file mode 100644
index 8b230a5a..00000000
--- a/js/components/routes.js
+++ /dev/null
@@ -1,25 +0,0 @@
-'use strict';
-
-import React from 'react';
-import Router from 'react-router';
-
-import App from './ascribe_app';
-import AppConstants from '../constants/application_constants';
-
-let Route = Router.Route;
-let Redirect = Router.Redirect;
-let baseUrl = AppConstants.baseUrl;
-
-
-function getRoutes(commonRoutes) {
- return (
-
-
-
- {commonRoutes}
-
- );
-}
-
-
-export default getRoutes;
diff --git a/js/components/whitelabel/prize/prize_app.js b/js/components/whitelabel/prize/prize_app.js
index dec859fc..29763ab3 100644
--- a/js/components/whitelabel/prize/prize_app.js
+++ b/js/components/whitelabel/prize/prize_app.js
@@ -7,6 +7,8 @@ import Header from '../../header';
import Footer from '../../footer';
import GlobalNotification from '../../global_notification';
+import getRoutes from './prize_routes';
+
let RouteHandler = Router.RouteHandler;
let PrizeApp = React.createClass({
@@ -14,10 +16,14 @@ let PrizeApp = React.createClass({
render() {
let header = null;
+ let subdomain = window.location.host.split('.')[0];
+
+ let ROUTES = getRoutes(null, subdomain);
+
if (this.isActive('landing') || this.isActive('login') || this.isActive('signup')) {
header = ;
} else {
- header = ;
+ header = ;
}
return (
diff --git a/js/components/whitelabel/prize/prize_routes.js b/js/components/whitelabel/prize/prize_routes.js
index 1384d26b..a389cb83 100644
--- a/js/components/whitelabel/prize/prize_routes.js
+++ b/js/components/whitelabel/prize/prize_routes.js
@@ -29,8 +29,8 @@ function getRoutes() {
-
-
+
+
diff --git a/js/components/whitelabel/wallet/wallet_routes.js b/js/components/whitelabel/wallet/wallet_routes.js
index 941c5a9c..a315bf3d 100644
--- a/js/components/whitelabel/wallet/wallet_routes.js
+++ b/js/components/whitelabel/wallet/wallet_routes.js
@@ -41,8 +41,8 @@ let ROUTES = {
-
-
+
+
@@ -56,8 +56,8 @@ let ROUTES = {
-
-
+
+
@@ -70,9 +70,9 @@ let ROUTES = {
-
-
-
+
+
+
diff --git a/js/routes.js b/js/routes.js
index 65dfbaac..f76e4b45 100644
--- a/js/routes.js
+++ b/js/routes.js
@@ -5,7 +5,8 @@ import Router from 'react-router';
import getPrizeRoutes from './components/whitelabel/prize/prize_routes';
import getWalletRoutes from './components/whitelabel/wallet/wallet_routes';
-import getDefaultRoutes from './components/routes';
+
+import App from './components/ascribe_app';
import PieceList from './components/piece_list';
import PieceContainer from './components/ascribe_detail/piece_container';
@@ -23,19 +24,25 @@ import RegisterPiece from './components/register_piece';
import PrizesDashboard from './components/ascribe_prizes_dashboard/prizes_dashboard';
+import AppConstants from './constants/application_constants';
+
let Route = Router.Route;
+let Redirect = Router.Redirect;
+let baseUrl = AppConstants.baseUrl;
const COMMON_ROUTES = (
-
+
+
+
-
+
+
-
@@ -51,7 +58,7 @@ function getRoutes(type, subdomain) {
} else if(type === 'wallet') {
routes = getWalletRoutes(COMMON_ROUTES, subdomain);
} else {
- routes = getDefaultRoutes(COMMON_ROUTES);
+ routes = COMMON_ROUTES;
}
return routes;