fix: Flash of sidebar when first loading Document chunk

This commit is contained in:
Tom Moor
2021-06-09 18:01:35 -07:00
parent 6beb6febc4
commit f58032d305

View File

@@ -40,43 +40,44 @@ export default function AuthenticatedRoutes() {
return ( return (
<SocketProvider> <SocketProvider>
<Layout> <Layout>
<Switch> <React.Suspense
<Redirect from="/dashboard" to="/home" /> fallback={
<Route path="/home/:tab" component={Home} /> <CenteredContent>
<Route path="/home" component={Home} /> <LoadingPlaceholder />
<Route exact path="/starred" component={Starred} /> </CenteredContent>
<Route exact path="/starred/:sort" component={Starred} /> }
<Route exact path="/templates" component={Templates} /> >
<Route exact path="/templates/:sort" component={Templates} /> <Switch>
<Route exact path="/drafts" component={Drafts} /> <Redirect from="/dashboard" to="/home" />
<Route exact path="/archive" component={Archive} /> <Route path="/home/:tab" component={Home} />
<Route exact path="/trash" component={Trash} /> <Route path="/home" component={Home} />
<Redirect exact from="/collections/*" to="/collection/*" /> <Route exact path="/starred" component={Starred} />
<Route exact path="/collection/:id/new" component={DocumentNew} /> <Route exact path="/starred/:sort" component={Starred} />
<Route exact path="/collection/:id/:tab" component={Collection} /> <Route exact path="/templates" component={Templates} />
<Route exact path="/collection/:id" component={Collection} /> <Route exact path="/templates/:sort" component={Templates} />
<Route exact path={`/d/${slug}`} component={RedirectDocument} /> <Route exact path="/drafts" component={Drafts} />
<Route <Route exact path="/archive" component={Archive} />
exact <Route exact path="/trash" component={Trash} />
path={`/doc/${slug}/history/:revisionId?`} <Redirect exact from="/collections/*" to="/collection/*" />
component={KeyedDocument} <Route exact path="/collection/:id/new" component={DocumentNew} />
/> <Route exact path="/collection/:id/:tab" component={Collection} />
<Route exact path={`/doc/${slug}/edit`} component={KeyedDocument} /> <Route exact path="/collection/:id" component={Collection} />
<Route path={`/doc/${slug}`} component={KeyedDocument} /> <Route exact path={`/d/${slug}`} component={RedirectDocument} />
<Route exact path="/search" component={Search} /> <Route
<Route exact path="/search/:term" component={Search} /> exact
<Route path="/404" component={Error404} /> path={`/doc/${slug}/history/:revisionId?`}
<React.Suspense component={KeyedDocument}
fallback={ />
<CenteredContent> <Route exact path={`/doc/${slug}/edit`} component={KeyedDocument} />
<LoadingPlaceholder /> <Route path={`/doc/${slug}`} component={KeyedDocument} />
</CenteredContent> <Route exact path="/search" component={Search} />
} <Route exact path="/search/:term" component={Search} />
> <Route path="/404" component={Error404} />
<SettingsRoutes /> <SettingsRoutes />
</React.Suspense> <Route component={NotFound} />
<Route component={NotFound} /> </Switch>{" "}
</Switch> </React.Suspense>
</Layout> </Layout>
</SocketProvider> </SocketProvider>
); );