From 648d8f8c83b340522b43999fc1107ba44aac1116 Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 22 Oct 2024 14:04:20 +0200 Subject: [PATCH] Inline in jsx --- .../media/common/paginatedMediaGallery.js | 35 +++++++++---------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/packages/story-editor/src/components/library/panes/media/common/paginatedMediaGallery.js b/packages/story-editor/src/components/library/panes/media/common/paginatedMediaGallery.js index ec38ef7be7f5..5e6127ca8afa 100644 --- a/packages/story-editor/src/components/library/panes/media/common/paginatedMediaGallery.js +++ b/packages/story-editor/src/components/library/panes/media/common/paginatedMediaGallery.js @@ -197,23 +197,6 @@ function PaginatedMediaGallery({ }; }, [handleScrollOrResize]); - const mediaGallery = - isMediaLoaded && !resources.length && !uploadingResources.length ? ( - - {__('No media found.', 'web-stories')} - - ) : ( -
- -
- ); - const [showLoadingPill, setShowLoadingPill] = useState(false); useEffect(() => { @@ -238,7 +221,23 @@ function PaginatedMediaGallery({ data-testid="media-gallery-container" ref={refContainer} > - {mediaGallery} + + {isMediaLoaded && !resources.length && !uploadingResources.length ? ( + + {__('No media found.', 'web-stories')} + + ) : ( +
+ +
+ )} +
{showLoadingPill && (