fix: Delayed mount around all sidebar loading indicators

This commit is contained in:
Tom Moor
2023-05-20 17:20:47 -04:00
parent 31b9c2b8a4
commit 965d85fb6f
2 changed files with 9 additions and 9 deletions

View File

@@ -5,7 +5,6 @@ import { useTranslation } from "react-i18next";
import styled from "styled-components";
import Collection from "~/models/Collection";
import Document from "~/models/Document";
import DelayedMount from "~/components/DelayedMount";
import DocumentsLoader from "~/components/DocumentsLoader";
import { ResizingHeightContainer } from "~/components/ResizingHeightContainer";
import usePolicy from "~/hooks/usePolicy";
@@ -78,9 +77,7 @@ function CollectionLinkChildren({
<DocumentsLoader collection={collection} enabled={expanded}>
{!childDocuments && (
<ResizingHeightContainer hideOverflow>
<DelayedMount>
<Loading />
</DelayedMount>
<Loading />
</ResizingHeightContainer>
)}
{childDocuments?.map((node, index) => (

View File

@@ -1,14 +1,17 @@
import * as React from "react";
import styled from "styled-components";
import DelayedMount from "~/components/DelayedMount";
import PlaceholderText from "~/components/PlaceholderText";
function PlaceholderCollections(props: React.HTMLAttributes<HTMLDivElement>) {
return (
<Wrapper {...props}>
<PlaceholderText />
<PlaceholderText delay={0.2} />
<PlaceholderText delay={0.4} />
</Wrapper>
<DelayedMount>
<Wrapper {...props}>
<PlaceholderText />
<PlaceholderText delay={0.2} />
<PlaceholderText delay={0.4} />
</Wrapper>
</DelayedMount>
);
}