mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-05 19:59:37 -06:00
40 lines
955 B
JavaScript
40 lines
955 B
JavaScript
import React, { ReactElement, lazy } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Route, Switch } from 'react-router-dom';
|
|
|
|
import PrivateRoute from './components/PrivateRoute';
|
|
|
|
const AsyncLogin = lazy(() =>
|
|
import(/* webpackChunkName: "containers-login" */ './containers/Login'));
|
|
const AsyncWelcome = lazy(() =>
|
|
import(/* webpackChunkName: "containers-welcome" */ './containers/Welcome'));
|
|
const AsyncGoodbye = lazy(() =>
|
|
import(/* webpackChunkName: "containers-goodbye" */ './containers/Goodbye'));
|
|
|
|
const Routes = ({ hello }: {hello: PropTypes.object}): ReactElement => (
|
|
<Switch>
|
|
<PrivateRoute
|
|
path="/welcome"
|
|
exact
|
|
component={AsyncWelcome}
|
|
hello={hello}
|
|
/>
|
|
<Route
|
|
path="/goodbye"
|
|
exact
|
|
component={AsyncGoodbye}
|
|
/>
|
|
<Route
|
|
path="/"
|
|
component={AsyncLogin}
|
|
/>
|
|
</Switch>
|
|
);
|
|
|
|
Routes.propTypes = {
|
|
hello: PropTypes.object
|
|
};
|
|
|
|
export default Routes;
|