Using appContext in DataSourceWrapper and createRoutes

This commit is contained in:
dannyrb committed 2020-05-17 22:18:25 -04:00
1 parent c2853f719a
commit 70ad940941
6 files changed
+31 -34

No files matched your search

+4 -6
View File
@@ -7,6 +7,7 @@ import NotFound from './NotFound';
import buildModeRoutes from './buildModeRoutes';
// TODO: Make these configurable
// TODO: Include "routes" debug route if dev build
const bakedInRoutes = [
// WORK LIST
{
@@ -19,16 +20,13 @@ const bakedInRoutes = [
{ component: NotFound },
];
const createRoutes = (modes, dataSources, extensionManager, t, t2) => {
console.log('Creating Routes: ', routes, bakedInRoutes);
console.log(modes, dataSources, extensionManager, t, t2);
if (!modes.length) {
modes.push(window.exampleMode);
}
const createRoutes = (modes, dataSources, extensionManager) => {
const routes = buildModeRoutes(modes, dataSources, extensionManager) || [];
// TODO: Shouldn't need to guard input routes with an empty array?
const allRoutes = [...(routes || []), ...bakedInRoutes];
console.log('Creating Routes: ', modes, dataSources, routes, bakedInRoutes, allRoutes);
return (
<Switch>
{allRoutes.map((route, i) => {