mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
Rename routes prop to flattenedRoutes
This commit is contained in:
parent
e656b4098a
commit
078569e71d
2 changed files with 5 additions and 5 deletions
|
|
@ -6,7 +6,7 @@ import { NamedRedirect } from './components';
|
|||
import * as propTypes from './util/propTypes';
|
||||
|
||||
const Routes = props => {
|
||||
const { isAuthenticated, routes } = props;
|
||||
const { isAuthenticated, flattenedRoutes } = props;
|
||||
|
||||
const renderComponent = (route, matchProps) => {
|
||||
const { auth, component: Component } = route;
|
||||
|
|
@ -28,7 +28,7 @@ const Routes = props => {
|
|||
|
||||
return (
|
||||
<Switch>
|
||||
{routes.map(toRouteComponent)}
|
||||
{flattenedRoutes.map(toRouteComponent)}
|
||||
<Route component={NotFoundPage} />
|
||||
</Switch>
|
||||
);
|
||||
|
|
@ -38,7 +38,7 @@ const { bool, arrayOf } = PropTypes;
|
|||
|
||||
Routes.propTypes = {
|
||||
isAuthenticated: bool.isRequired,
|
||||
routes: arrayOf(propTypes.route).isRequired,
|
||||
flattenedRoutes: arrayOf(propTypes.route).isRequired,
|
||||
};
|
||||
|
||||
const mapStateToProps = state => ({ isAuthenticated: state.Auth.isAuthenticated });
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export const ClientApp = props => {
|
|||
<Provider store={store}>
|
||||
<RoutesProvider routes={routesConfiguration}>
|
||||
<BrowserRouter>
|
||||
<Routes routes={flattenedRoutes} />
|
||||
<Routes flattenedRoutes={flattenedRoutes} />
|
||||
</BrowserRouter>
|
||||
</RoutesProvider>
|
||||
</Provider>
|
||||
|
|
@ -42,7 +42,7 @@ export const ServerApp = props => {
|
|||
<Provider store={store}>
|
||||
<RoutesProvider routes={routesConfiguration}>
|
||||
<StaticRouter location={url} context={context}>
|
||||
<Routes routes={flattenedRoutes} />
|
||||
<Routes flattenedRoutes={flattenedRoutes} />
|
||||
</StaticRouter>
|
||||
</RoutesProvider>
|
||||
</Provider>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue