feat: video gallery thumbnail fallback (#412)

This commit is contained in:
Artur Gaspar
2023-12-04 11:58:40 -03:00
committed by GitHub
parent 1ddaf9a662
commit 1c9771b332
5 changed files with 253 additions and 60 deletions

View File

@@ -23,6 +23,7 @@ export const Gallery = ({
showIdsOnCards,
height,
isLoaded,
thumbnailFallback,
}) => {
const intl = useIntl();
if (!isLoaded) {
@@ -66,7 +67,14 @@ export const Gallery = ({
type="radio"
value={highlighted}
>
{ displayList.map(asset => <GalleryCard key={asset.id} asset={asset} showId={showIdsOnCards} />) }
{ displayList.map(asset => (
<GalleryCard
key={asset.id}
asset={asset}
showId={showIdsOnCards}
thumbnailFallback={thumbnailFallback}
/>
)) }
</SelectableBox.Set>
</div>
</Scrollable>
@@ -78,6 +86,7 @@ Gallery.defaultProps = {
showIdsOnCards: false,
height: '375px',
show: true,
thumbnailFallback: undefined,
};
Gallery.propTypes = {
show: PropTypes.bool,
@@ -90,6 +99,7 @@ Gallery.propTypes = {
emptyGalleryLabel: PropTypes.shape({}).isRequired,
showIdsOnCards: PropTypes.bool,
height: PropTypes.string,
thumbnailFallback: PropTypes.element,
};
export default Gallery;