2018-04-26 11:19:19 -04:00
```js
const noop = () => {};
2018-11-14 10:47:19 -08:00
const mediaItems = [
2018-05-04 18:24:33 -07:00
{
2018-07-09 14:29:13 -07:00
objectURL: 'https://placekitten.com/799/600',
2018-11-14 10:47:19 -08: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-04 18:24:33 -07:00
},
{
objectURL: 'https://placekitten.com/900/600',
2018-11-14 10:47:19 -08:00
contentType: 'image/jpeg',
message: { id: 2 },
attachment: { contentType: 'image/jpeg' },
2018-05-07 21:34:44 -04:00
},
2018-07-09 14:29:13 -07:00
// Unsupported image type
2018-05-07 21:34:44 -04:00
{
objectURL: 'foo.tif',
2018-11-14 10:47:19 -08:00
contentType: 'image/tiff',
message: { id: 3 },
attachment: { contentType: 'image/tiff' },
2018-05-04 18:24:33 -07:00
},
2018-07-09 14:29:13 -07:00
// Video
{
objectURL: util.mp4ObjectUrl,
2018-11-14 10:47:19 -08:00
contentType: 'video/mp4',
message: { id: 4 },
attachment: { contentType: 'video/mp4' },
2018-07-09 14:29:13 -07:00
},
2018-11-28 12:34:29 -08:00
{
objectURL: util.mp4ObjectUrlV2,
contentType: 'video/mp4',
message: { id: 5 },
attachment: { contentType: 'video/mp4' },
},
2018-05-04 18:24:33 -07:00
{
objectURL: 'https://placekitten.com/980/800',
2018-11-14 10:47:19 -08:00
contentType: 'image/jpeg',
2018-11-28 12:34:29 -08:00
message: { id: 6 },
2018-11-14 10:47:19 -08:00
attachment: { contentType: 'image/jpeg' },
2018-05-04 18:24:33 -07:00
},
{
objectURL: 'https://placekitten.com/656/540',
2018-11-14 10:47:19 -08:00
contentType: 'image/jpeg',
2018-11-28 12:34:29 -08:00
message: { id: 7 },
2018-11-14 10:47:19 -08:00
attachment: { contentType: 'image/jpeg' },
2018-05-04 18:24:33 -07:00
},
{
objectURL: 'https://placekitten.com/762/400',
2018-11-14 10:47:19 -08:00
contentType: 'image/jpeg',
2018-11-28 12:34:29 -08:00
message: { id: 8 },
2018-11-14 10:47:19 -08:00
attachment: { contentType: 'image/jpeg' },
2018-05-04 18:24:33 -07:00
},
{
objectURL: 'https://placekitten.com/920/620',
2018-11-14 10:47:19 -08:00
contentType: 'image/jpeg',
2018-11-28 12:34:29 -08:00
message: { id: 9 },
2018-11-14 10:47:19 -08:00
attachment: { contentType: 'image/jpeg' },
2018-05-04 18:24:33 -07:00
},
2018-04-26 11:19:19 -04:00
];
2018-05-01 15:37:21 -07:00
< div style = {{ position: ' relative ' , width: ' 100 % ' , height: 500 } } >
2018-11-14 10:47:19 -08:00
< LightboxGallery media = {mediaItems} onSave = {noop} i18n = {util.i18n} / >
2018-05-01 15:37:21 -07:00
< / div > ;
2018-04-26 11:19:19 -04:00
```