Revert "feat: improve asset loading (#484)"

This reverts commit f3ae225d64.
This commit is contained in:
bszabo
2024-06-26 10:02:59 -04:00
committed by GitHub
parent c84e3229f6
commit ba8141ea6a
47 changed files with 404 additions and 635 deletions

View File

@@ -11,7 +11,6 @@ import {
import SelectableBox from '../SelectableBox';
import messages from './messages';
import GalleryCard from './GalleryCard';
import GalleryLoadMoreButton from './GalleryLoadMoreButton';
export const Gallery = ({
galleryIsEmpty,
@@ -24,13 +23,9 @@ export const Gallery = ({
height,
isLoaded,
thumbnailFallback,
allowLazyLoad,
fetchNextPage,
assetCount,
}) => {
const intl = useIntl();
if (!isLoaded && !allowLazyLoad) {
if (!isLoaded) {
return (
<div style={{
position: 'absolute',
@@ -70,7 +65,7 @@ export const Gallery = ({
type="radio"
value={highlighted}
>
{displayList.map(asset => (
{ displayList.map(asset => (
<GalleryCard
key={asset.id}
asset={asset}
@@ -79,16 +74,6 @@ export const Gallery = ({
/>
)) }
</SelectableBox.Set>
{allowLazyLoad && (
<GalleryLoadMoreButton
{...{
fetchNextPage,
assetCount,
displayListLength: displayList.length,
isLoaded,
}}
/>
)}
</div>
);
};
@@ -99,9 +84,6 @@ Gallery.defaultProps = {
height: '375px',
show: true,
thumbnailFallback: undefined,
allowLazyLoad: false,
fetchNextPage: null,
assetCount: 0,
};
Gallery.propTypes = {
show: PropTypes.bool,
@@ -115,9 +97,6 @@ Gallery.propTypes = {
showIdsOnCards: PropTypes.bool,
height: PropTypes.string,
thumbnailFallback: PropTypes.element,
allowLazyLoad: PropTypes.bool,
fetchNextPage: PropTypes.func,
assetCount: PropTypes.number,
};
export default Gallery;