Skip to content

Commit

Permalink
Inline in jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Oct 22, 2024
1 parent aa26974 commit 648d8f8
Showing 1 changed file with 17 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -197,23 +197,6 @@ function PaginatedMediaGallery({
};
}, [handleScrollOrResize]);

const mediaGallery =
isMediaLoaded && !resources.length && !uploadingResources.length ? (
<MediaGalleryMessage>
{__('No media found.', 'web-stories')}
</MediaGalleryMessage>
) : (
<div style={{ marginBottom: 15 }}>
<LazyMediaGallery
providerType={providerType}
canEditMedia={canEditMedia}
resources={resources}
uploadingResources={uploadingResources}
onInsert={onInsert}
/>
</div>
);

const [showLoadingPill, setShowLoadingPill] = useState(false);

useEffect(() => {
Expand All @@ -238,7 +221,23 @@ function PaginatedMediaGallery({
data-testid="media-gallery-container"
ref={refContainer}
>
<MediaGalleryInnerContainer>{mediaGallery}</MediaGalleryInnerContainer>
<MediaGalleryInnerContainer>
{isMediaLoaded && !resources.length && !uploadingResources.length ? (
<MediaGalleryMessage>
{__('No media found.', 'web-stories')}
</MediaGalleryMessage>
) : (
<div style={{ marginBottom: 15 }}>
<LazyMediaGallery
providerType={providerType}
canEditMedia={canEditMedia}
resources={resources}
uploadingResources={uploadingResources}
onInsert={onInsert}
/>
</div>
)}
</MediaGalleryInnerContainer>
</MediaGalleryContainer>
{showLoadingPill && (
<MediaGalleryLoadingPill data-testid={'loading-pill'}>
Expand Down

0 comments on commit 648d8f8

Please sign in to comment.