-
+const { any, array, bool, func, node, oneOfType, string } = PropTypes;
- {/* Search view */}
-
+MatchWithSubRoutes.propTypes = {
+ pattern: string.isRequired,
+ auth: bool,
+ exactly: bool,
+ name: string.isRequired,
+ component: oneOfType([ func, node ]).isRequired,
+};
- {/* Listing view */}
-
-
+const Routes = props => {
+ const flattenedRoutes = flattenRoutes(props.routes);
+ const matches = flattenedRoutes.map(route =>
);
- {/* profile / storefront view */}
-
-
-
+ return (
+
+
+
+ {matches}
+
+
+
+
+ );
+};
- {/* checkout */}
-
-
- {/* Login and signup */}
-
}
- />
- }
- />
-
- {/* Password forgotten */}
-
-
- {/* Change password */}
-
-
- {/* Inbox and filtered views */}
- }
- />
- }
- />
- }
- />
-
- {/* Order/Conversation and mobile views */}
-
- }
- />
- }
- />
- }
- />
- }
- />
- }
- />
- }
- />
-
- {/* Manage listings */}
-
-
- {/* Account settings */}
- }
- />
-
-
-
-
-
-
-
- );
- }
-}
-
-const { any } = PropTypes;
-
-Routes.propTypes = { router: any.isRequired };
-Routes.childContextTypes = { router: React.PropTypes.object };
+Routes.propTypes = { router: any.isRequired, routes: array.isRequired };
export default Routes;
diff --git a/src/app.js b/src/app.js
index 4c82629b..ff1438c1 100644
--- a/src/app.js
+++ b/src/app.js
@@ -5,6 +5,7 @@ import { BrowserRouter, ServerRouter } from 'react-router';
import { Provider } from 'react-redux';
import configureStore from './store';
import Routes from './Routes';
+import routesConfiguration from './routesConfiguration';
export const ClientApp = props => {
const { store } = props;
@@ -12,7 +13,7 @@ export const ClientApp = props => {