{"size": 1899, "ext": "js", "max_stars_repo_path": "src/routes/index.js", "max_stars_repo_name": "interactive-solutions/backoffice-starterkit", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/routes/index.js", "max_issues_repo_name": "interactive-solutions/backoffice-starterkit", "max_issues_repo_issues_event_min_datetime": "2018-01-10T10:06:53.000Z", "max_issues_repo_issues_event_max_datetime": "2018-02-27T14:36:56.000Z", "max_forks_repo_path": "src/routes/index.js", "max_forks_repo_name": "interactive-solutions/backoffice-starterkit", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 17, "max_forks_count": null, "avg_line_length": 39.5625, "max_line_length": 137, "alphanum_fraction": 0.6466561348}
import React from 'react';
import { Switch, Route, Redirect } from 'react-router-dom';
import L from 'react-loadable';
import { Loader, Dimmer } from 'semantic-ui-react';
import { NavbarContainer } from 'components';
import { CoreLayout } from '../layouts/core-layout/core-layout';
import { requiresAuthentication } from './utils';

const Loadable = opts =>
  L({
    loading: () => (
      <Dimmer active inverted>
        <Loader inverted size='massive' content='Loading'/>
      </Dimmer>
    ),
    ...opts
  });
  /* eslint-disable */
const LoginContainer = Loadable({ loader: () => import(/* webpackChunkName: 'login' */ './login/login') });
const ForgotPassword = Loadable({ loader: () => import(/* webpackChunkName: 'forgot-password' */ './forgot-password/forgot-password') });
const ResetPassword = Loadable({ loader: () => import(/* webpackChunkName: 'reset-password' */ './reset-password/reset-password') });
const Dashboard = Loadable({ loader: () => import(/* webpackChunkName: 'dashboard' */ './dashboard/dashboard') });
const Users = Loadable({ loader: () => import(/* webpackChunkName: 'users' */ './users/users') });
  /* eslint-enable */

const RoutingNavbar = requiresAuthentication(NavbarContainer);

export const createRoutes = () => (
  <CoreLayout>
    <Switch>
      <Route exact path='/' component={LoginContainer}/>
      <Route exact path='/login' component={LoginContainer}/>
      <Route exact path='/forgot-password' component={ForgotPassword}/>
      <Route exact path='/reset-password/:nonce' component={ResetPassword}/>
      <RoutingNavbar>
        <Switch>
          <Route exact path='/dashboard' component={Dashboard}/>
          <Route exact path='/users' component={Users}/>
          <Redirect path='*' to='/dashboard'/>
        </Switch>
      </RoutingNavbar>
      <Redirect path='*' to='/'/>
    </Switch>
  </CoreLayout>
);

export default createRoutes;
