PluginProbe
Extendify / trunk
Extendify vtrunk
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Draft / components / stock-images / UnsplashImages.jsx

UnsplashImages.jsx in Extendify trunk, at src/Draft/components/stock-images/UnsplashImages.jsx

33 lines 758 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { UnsplashImage } from '@draft/components/stock-images/UnsplashImage';
2 import { __ } from '@wordpress/i18n';
3
4 export const UnsplashImages = ({
5 images,
6 isInsertingImage,
7 onClick,
8 loading,
9 }) => {
10 const imageLength = images?.length ?? 10;
11
12 if (!loading && !images.length) {
13 return __('No images found.', 'extendify-local');
14 }
15
16 return (
17 <div className="columns-2 gap-1">
18 {Array.from({ length: imageLength }).map((_, idx) => {
19 const skeletonHeight = [150, 175, 200];
20 return (
21 <UnsplashImage
22 key={images?.[idx]?.id ?? idx}
23 image={images?.[idx]}
24 skeletonHeight={skeletonHeight[idx % skeletonHeight.length]}
25 isInsertingImage={isInsertingImage}
26 onClick={onClick}
27 />
28 );
29 })}
30 </div>
31 );
32 };
33