Skip to content

Commit

Permalink
Fix example thumbnails (#7001)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementPasteau authored Sep 30, 2024
1 parent 9b85f35 commit f0567b6
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions newIDE/app/src/AssetStore/ShopTiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,21 @@ export const ExampleTile = ({
customTitle?: string,
useQuickCustomizationThumbnail?: boolean,
|}) => {
const thumbnailImgUrl = exampleShortHeader
? useQuickCustomizationThumbnail
? exampleShortHeader.quickCustomizationImageUrl
? exampleShortHeader.quickCustomizationImageUrl
: exampleShortHeader.previewImageUrls
? exampleShortHeader.previewImageUrls[0]
: ''
: ''
: '';
const thumbnailImgUrl = React.useMemo(
() => {
if (!exampleShortHeader) return '';
const firstPreviewUrl = exampleShortHeader.previewImageUrls[0] || '';
const quickCustomizationImageUrl =
exampleShortHeader.quickCustomizationImageUrl;
if (useQuickCustomizationThumbnail && quickCustomizationImageUrl) {
return quickCustomizationImageUrl;
}

return firstPreviewUrl;
},
[exampleShortHeader, useQuickCustomizationThumbnail]
);

const classesForGridListItem = useStylesForGridListItem();
return (
<GridListTile
Expand Down

0 comments on commit f0567b6

Please sign in to comment.