2018-04-26 15:19:19 +00:00
```js
const noop = () => {};
2018-11-14 18:47:19 +00:00
const mediaItems = [
2018-05-05 01:24:33 +00:00
{
2018-07-09 21:29:13 +00:00
objectURL: 'https://placekitten.com/799/600',
2018-11-14 18:47:19 +00:00
contentType: 'image/jpeg',
message: { id: 1 },
attachment: {
contentType: 'image/jpeg',
caption:
"This is a really long caption. Because the user had a lot to say. You know, it's very important to provide full context when sending an image. You don't want to make the wrong impression.",
},
2018-05-05 01:24:33 +00:00
},
{
objectURL: 'https://placekitten.com/900/600',
2018-11-14 18:47:19 +00:00
contentType: 'image/jpeg',
message: { id: 2 },
attachment: { contentType: 'image/jpeg' },
2018-05-08 01:34:44 +00:00
},
2018-07-09 21:29:13 +00:00
// Unsupported image type
2018-05-08 01:34:44 +00:00
{
objectURL: 'foo.tif',
2018-11-14 18:47:19 +00:00
contentType: 'image/tiff',
message: { id: 3 },
attachment: { contentType: 'image/tiff' },
2018-05-05 01:24:33 +00:00
},
2018-07-09 21:29:13 +00:00
// Video
{
objectURL: util.mp4ObjectUrl,
2018-11-14 18:47:19 +00:00
contentType: 'video/mp4',
message: { id: 4 },
attachment: { contentType: 'video/mp4' },
2018-07-09 21:29:13 +00:00
},
2018-11-28 20:34:29 +00:00
{
objectURL: util.mp4ObjectUrlV2,
contentType: 'video/mp4',
message: { id: 5 },
attachment: { contentType: 'video/mp4' },
},
2018-05-05 01:24:33 +00:00
{
objectURL: 'https://placekitten.com/980/800',
2018-11-14 18:47:19 +00:00
contentType: 'image/jpeg',
2018-11-28 20:34:29 +00:00
message: { id: 6 },
2018-11-14 18:47:19 +00:00
attachment: { contentType: 'image/jpeg' },
2018-05-05 01:24:33 +00:00
},
{
objectURL: 'https://placekitten.com/656/540',
2018-11-14 18:47:19 +00:00
contentType: 'image/jpeg',
2018-11-28 20:34:29 +00:00
message: { id: 7 },
2018-11-14 18:47:19 +00:00
attachment: { contentType: 'image/jpeg' },
2018-05-05 01:24:33 +00:00
},
{
objectURL: 'https://placekitten.com/762/400',
2018-11-14 18:47:19 +00:00
contentType: 'image/jpeg',
2018-11-28 20:34:29 +00:00
message: { id: 8 },
2018-11-14 18:47:19 +00:00
attachment: { contentType: 'image/jpeg' },
2018-05-05 01:24:33 +00:00
},
{
objectURL: 'https://placekitten.com/920/620',
2018-11-14 18:47:19 +00:00
contentType: 'image/jpeg',
2018-11-28 20:34:29 +00:00
message: { id: 9 },
2018-11-14 18:47:19 +00:00
attachment: { contentType: 'image/jpeg' },
2018-05-05 01:24:33 +00:00
},
2018-04-26 15:19:19 +00:00
];
2018-05-01 22:37:21 +00:00
< div style = {{ position: ' relative ' , width: ' 100 % ' , height: 500 } } >
2018-11-14 18:47:19 +00:00
< LightboxGallery media = {mediaItems} onSave = {noop} i18n = {util.i18n} / >
2018-05-01 22:37:21 +00:00
< / div > ;
2018-04-26 15:19:19 +00:00
```