From 120c8f373c91512378c3150f0419ff3b291d3613 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Sat, 25 Jun 2022 20:10:53 +0200 Subject: [PATCH] fix: library not scrollable when no published items installed (#5352) * fix: library not scrollable when no published items installed * show empty lib message in one case & fix i18n --- src/components/LibraryMenuItems.tsx | 22 +++++++++++++++++++--- src/locales/en.json | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/components/LibraryMenuItems.tsx b/src/components/LibraryMenuItems.tsx index 22251859..01223bae 100644 --- a/src/components/LibraryMenuItems.tsx +++ b/src/components/LibraryMenuItems.tsx @@ -428,7 +428,7 @@ const LibraryMenuItems = ({ align="start" gap={1} style={{ - flex: publishedItems.length > 0 ? 1 : "0 0 auto", + flex: publishedItems.length > 0 ? 1 : "0 1 auto", marginBottom: 0, }} > @@ -467,7 +467,7 @@ const LibraryMenuItems = ({ fontSize: ".9rem", }} > - No items yet! + {t("library.noItems")}
0 || unpublishedItems.length > 0))) && (
{t("labels.excalidrawLib")}
)} - {publishedItems.length > 0 && renderLibrarySection(publishedItems)} + {publishedItems.length > 0 ? ( + renderLibrarySection(publishedItems) + ) : unpublishedItems.length > 0 ? ( +
+ {t("library.noItems")} +
+ ) : null} ); diff --git a/src/locales/en.json b/src/locales/en.json index b20f6a4e..36dd36fc 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -124,6 +124,7 @@ "sidebarLock": "Keep sidebar open" }, "library": { + "noItems": "No items added yet...", "hint_emptyLibrary": "Select an item on canvas to add it here, or install a library from the public repository, below.", "hint_emptyPrivateLibrary": "Select an item on canvas to add it here." },