From 69b6fbb3f4abd047d230f8ee32a9f7a89e1580fd Mon Sep 17 00:00:00 2001 From: David Luzar Date: Tue, 8 Jun 2021 23:14:02 +0200 Subject: [PATCH] feat: pass current `theme` when installing libraries (#3701) * pass current `theme` when installing libraries * pass `theme` instead of `appState` --- src/components/LayerUI.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/LayerUI.tsx b/src/components/LayerUI.tsx index c69d87f6c..dc245fc24 100644 --- a/src/components/LayerUI.tsx +++ b/src/components/LayerUI.tsx @@ -107,6 +107,7 @@ const LibraryMenuItems = ({ onAddToLibrary, onInsertShape, pendingElements, + theme, setAppState, setLibraryItems, libraryReturnUrl, @@ -119,6 +120,7 @@ const LibraryMenuItems = ({ onRemoveFromLibrary: (index: number) => void; onInsertShape: (elements: LibraryItem) => void; onAddToLibrary: (elements: LibraryItem) => void; + theme: AppState["theme"]; setAppState: React.Component["setState"]; setLibraryItems: (library: LibraryItems) => void; libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"]; @@ -192,7 +194,7 @@ const LibraryMenuItems = ({ {t("labels.libraries")} @@ -246,6 +248,7 @@ const LibraryMenu = ({ onInsertShape, pendingElements, onAddToLibrary, + theme, setAppState, libraryReturnUrl, focusContainer, @@ -256,6 +259,7 @@ const LibraryMenu = ({ onClickOutside: (event: MouseEvent) => void; onInsertShape: (elements: LibraryItem) => void; onAddToLibrary: () => void; + theme: AppState["theme"]; setAppState: React.Component["setState"]; libraryReturnUrl: ExcalidrawProps["libraryReturnUrl"]; focusContainer: () => void; @@ -345,6 +349,7 @@ const LibraryMenu = ({ libraryReturnUrl={libraryReturnUrl} focusContainer={focusContainer} library={library} + theme={theme} id={id} /> )} @@ -537,6 +542,7 @@ const LayerUI = ({ libraryReturnUrl={libraryReturnUrl} focusContainer={focusContainer} library={library} + theme={appState.theme} id={id} /> ) : null;