-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPhotoThumbnails.js
More file actions
74 lines (71 loc) · 2.78 KB
/
PhotoThumbnails.js
File metadata and controls
74 lines (71 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import React from 'react';
import { Image, Transformation } from 'cloudinary-react';
const transformations = [
[{ crop: 'fill', width: '150', height: '150', radius: '10' }],
[{ crop: 'scale', width: '150', height: '150' }],
[{ crop: 'fit', width: '150', height: '150' }],
[{ crop: 'thumb', gravity: 'face', width: '150', height: '150' }],
[
{
crop: 'fill',
effect: 'sepia',
gravity: 'north',
width: '150',
height: '150',
radius: '20',
},
{ angle: '20' },
],
];
const PhotoThumbnails = ({publicId}) => (
<table className="thumbnails">
<tbody>
<tr>
{transformations.map((transformation, transformationIndex) => {
return (
<td key={transformationIndex}>
<div className="thumbnail_holder">
<Image
publicId={publicId}
className="thumbnail inline"
format="jpg"
>
{transformation.map(
(subTransformation, subTransformationIndex) => {
return (
<Transformation
{...subTransformation}
key={subTransformationIndex}
/>
);
}
)}
</Image>
</div>
<table className="info">
<tbody>
{transformation.map(subTransformation => {
return Object.keys(subTransformation).map(
(prop, propIndex) => {
return (
<tr key={propIndex}>
<td>{prop}</td>
<td>
{subTransformation[prop]}
</td>
</tr>
);
}
);
})}
</tbody>
</table>
<br />
</td>
);
})}
</tr>
</tbody>
</table>
);
export default PhotoThumbnails;