1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import React, { Suspense } from "react";
- import { Switch } from "react-router-dom";
- import ProtectedRoute from './components/common/protectedRoute';
- import config from './configs/routerConfig';
- import Header from './components/public/Header';
- import Spinner from './components/common/spinner';
- const router = props => (
- <div className="app w-100 img slider-image ">
- <Header />
- <Suspense fallback={<Spinner />}>
- <Switch>
- {config.map(route =>
- <ProtectedRoute
- path={route.path}
- component={route.component}
- access={route.access}
- key={route.path}
- exact
- />
- )}
- </Switch>
- </Suspense>
- </div>
- )
- export default router;
- // class Router extends React.Component {
- // render() {
- // const { user, tokenAuth } = this.props;
- // // TODO: add footer
- // return (
- // <div className="app w-100 img slider-image ">
- // <Header />
- // <Suspense fallback={<Spinner />}>
- // <Switch>
- // {config.map(route =>
- // <ProtectedRoute
- // path={route.path}
- // component={route.component}
- // access={route.access}
- // user={user}
- // key={route}
- // exact
- // />
- // )}
- // </Switch>
- // </Suspense>
- // </div>
- // )
- // }
- // }
- // const mapStateToProps = state => ({
- // user: state.signIn
- // })
- // // const mapDispatchToProps = dispatch => bindActionCreators({ tokenAuth }, dispatch);
- // export default withRouter(connect(mapStateToProps, null)(Router));
- // >>>>>>> new_Sveta
|