Finished building blog overview page.
This commit is contained in:
@ -39,7 +39,8 @@ const AppRoutes = (props) => {
|
||||
<RouteWrapper exact path="/" page={ () => import('@pages/home/HomePage') } />
|
||||
<RouteWrapper exact path="/contact" page={ () => import ('@pages/contact/ContactPage') } />
|
||||
<RouteWrapper exact path="/legal/privacy" page={ () => import('@pages/legal/privacy/PrivacyPolicyPage') } />
|
||||
<RouteWrapper exact path="/blog" page={ () => import('@pages/blog/BlogPage') } />
|
||||
|
||||
<RouteWrapper exact path="/blog/:page?" page={ () => import('@pages/blog/BlogPage') } />
|
||||
</Routes>
|
||||
);
|
||||
};
|
||||
|
@ -39,12 +39,12 @@ const PageLoading = (props) => {
|
||||
};
|
||||
|
||||
export const RouteWrapper = (props) => {
|
||||
let render = () => {
|
||||
let render = subProps => {
|
||||
let CustomLoadable = Loadable({
|
||||
loader: props.page,
|
||||
loading: PageLoading
|
||||
});
|
||||
return <CustomLoadable />
|
||||
return <CustomLoadable {...props} {...subProps} />
|
||||
};
|
||||
|
||||
return <Route {...props} render={render} />;
|
||||
@ -53,11 +53,5 @@ export const RouteWrapper = (props) => {
|
||||
export default withRouter((props) => {
|
||||
const { match, location, history, children } = props;
|
||||
|
||||
return (
|
||||
<Route>
|
||||
<Switch location={ location }>
|
||||
{ children }
|
||||
</Switch>
|
||||
</Route>
|
||||
);
|
||||
return <Switch {...props} />;
|
||||
});
|
||||
|
Reference in New Issue
Block a user