This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/app/routes/index.js
2021-03-30 20:10:52 -07:00

35 lines
1.1 KiB
JavaScript

// @flow
import * as React from "react";
import { Switch } from "react-router-dom";
import DelayedMount from "components/DelayedMount";
import FullscreenLoading from "components/FullscreenLoading";
import Route from "components/ProfiledRoute";
const Authenticated = React.lazy(() => import("components/Authenticated"));
const AuthenticatedRoutes = React.lazy(() => import("./authenticated"));
const KeyedDocument = React.lazy(() => import("scenes/Document/KeyedDocument"));
const Login = React.lazy(() => import("scenes/Login"));
const Logout = React.lazy(() => import("scenes/Logout"));
export default function Routes() {
return (
<React.Suspense
fallback={
<DelayedMount delay={2000}>
<FullscreenLoading />
</DelayedMount>
}
>
<Switch>
<Route exact path="/" component={Login} />
<Route exact path="/create" component={Login} />
<Route exact path="/logout" component={Logout} />
<Route exact path="/share/:shareId" component={KeyedDocument} />
<Authenticated>
<AuthenticatedRoutes />
</Authenticated>
</Switch>
</React.Suspense>
);
}