* migration * frontend routing, api permissioning * feat: apiVersion=2 * feat: re-writing document links to point to share * poc nested documents on share links * fix: nested shareId permissions * ui and language tweaks, comments * breadcrumbs * Add icons to reference list items * refactor: Breadcrumb component * tweaks * Add shared parent note
41 lines
1.3 KiB
JavaScript
41 lines
1.3 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";
|
|
import { matchDocumentSlug as slug } from "utils/routeHelpers";
|
|
|
|
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} />
|
|
<Route
|
|
exact
|
|
path={`/share/:shareId/doc/${slug}`}
|
|
component={KeyedDocument}
|
|
/>
|
|
<Authenticated>
|
|
<AuthenticatedRoutes />
|
|
</Authenticated>
|
|
</Switch>
|
|
</React.Suspense>
|
|
);
|
|
}
|