From d4e9a6bec293bf516ea5f176511854c250b9f5dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B4mulo=20Penido?= Date: Thu, 7 Nov 2024 00:05:57 -0300 Subject: [PATCH] fix: add spacing to searchbar and simplify render conditions (#1476) Adds padding between the search bar and the library list. Also, the render method was refactored to be a bit simpler. Backport of #1461 --- .../component-picker/SelectLibrary.tsx | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/library-authoring/component-picker/SelectLibrary.tsx b/src/library-authoring/component-picker/SelectLibrary.tsx index 6ebf11a2e..2181d5c1f 100644 --- a/src/library-authoring/component-picker/SelectLibrary.tsx +++ b/src/library-authoring/component-picker/SelectLibrary.tsx @@ -83,44 +83,44 @@ const SelectLibrary = ({ selectedLibrary, setSelectedLibrary }: SelectLibraryPro value={searchQuery} placeholder={intl.formatMessage(messages.selectLibrarySearchPlaceholder)} /> -
- {data.results.length === 0 && ()} - ) => setSelectedLibrary(e.target.value)} - value={selectedLibrary} - > - {data.results.map((library) => ( - setSelectedLibrary(library.id)} - className="card-item" - > - {library.title}} - subtitle={`${library.org} / ${library.slug}`} - actions={( - {' '} - )} - /> - -

{library.description}

-
-
- ))} -
-
- {data.results.length !== 0 && ( - setCurrentPage(page)} - variant="secondary" - className="align-self-center" - /> + {data.results.length === 0 ? () : ( + <> + ) => setSelectedLibrary(e.target.value)} + value={selectedLibrary} + className="mt-4" + > + {data.results.map((library) => ( + setSelectedLibrary(library.id)} + className="card-item" + > + {library.title}} + subtitle={`${library.org} / ${library.slug}`} + actions={( + {' '} + )} + /> + +

{library.description}

+
+
+ ))} +
+ + )} );