fix: Cannot create collection if all existing collections are deleted (#3836)

This commit is contained in:
Tom Moor
2022-07-22 18:44:11 +01:00
committed by GitHub
parent 6fe4b1cba1
commit 87b4c9fdba
3 changed files with 3 additions and 19 deletions

View File

@@ -8,7 +8,6 @@ import Collection from "~/models/Collection";
import Flex from "~/components/Flex";
import Error from "~/components/List/Error";
import PaginatedList from "~/components/PaginatedList";
import Text from "~/components/Text";
import { createCollection } from "~/actions/definitions/collections";
import useStores from "~/hooks/useStores";
import DraggableCollectionLink from "./DraggableCollectionLink";
@@ -63,11 +62,6 @@ function Collections() {
/>
) : undefined
}
empty={
<Empty type="tertiary" size="small">
{t("Empty")}
</Empty>
}
renderError={(props) => <StyledError {...props} />}
renderItem={(item: Collection, index) => (
<DraggableCollectionLink
@@ -78,22 +72,14 @@ function Collections() {
belowCollection={orderedCollections[index + 1]}
/>
)}
>
<SidebarAction action={createCollection} depth={0} />
</PaginatedList>
/>
<SidebarAction action={createCollection} depth={0} />
</Relative>
</Header>
</Flex>
);
}
const Empty = styled(Text)`
margin-left: 36px;
margin-bottom: 0;
line-height: 34px;
font-style: italic;
`;
const StyledError = styled(Error)`
font-size: 15px;
padding: 0 8px;