From 9a913808965bc0df6282b2da597771b138696cd9 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Tue, 14 Feb 2017 14:20:32 +0200 Subject: [PATCH] Provide routesConfiguration and use flattened routes for Routes --- src/app.js | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/app.js b/src/app.js index 7cee3a7f..b032c8fb 100644 --- a/src/app.js +++ b/src/app.js @@ -7,19 +7,23 @@ import { IntlProvider, addLocaleData } from 'react-intl'; import en from 'react-intl/locale-data/en'; import configureStore from './store'; import Routes from './Routes'; -import routesConfiguration from './routesConfiguration'; +import { RoutesProvider } from './components'; +import routesConfiguration, { flattenRoutes } from './routesConfiguration'; import localeData from './translations/en.json'; export const ClientApp = props => { const { store } = props; addLocaleData([...en]); + const flattenedRoutes = flattenRoutes(routesConfiguration); return ( - - - - - + + + + + + + ); }; @@ -31,13 +35,16 @@ ClientApp.propTypes = { store: any.isRequired }; export const ServerApp = props => { const { url, context, store } = props; addLocaleData([...en]); + const flattenedRoutes = flattenRoutes(routesConfiguration); return ( - - - - - + + + + + + + ); };