2018-07-20 23:37:57 +00:00
|
|
|
#### With image
|
2018-07-09 21:29:13 +00:00
|
|
|
|
|
|
|
```jsx
|
2018-11-14 18:47:19 +00:00
|
|
|
const mediaItem = {
|
2018-07-18 23:00:51 +00:00
|
|
|
thumbnailObjectUrl: 'https://placekitten.com/76/67',
|
2018-11-14 18:47:19 +00:00
|
|
|
contentType: 'image/jpeg',
|
|
|
|
attachment: {
|
|
|
|
fileName: 'foo.jpg',
|
|
|
|
contentType: 'image/jpeg',
|
|
|
|
},
|
2018-07-18 23:00:51 +00:00
|
|
|
};
|
2018-11-14 18:47:19 +00:00
|
|
|
<MediaGridItem i18n={util.i18n} mediaItem={mediaItem} />;
|
2018-07-18 23:00:51 +00:00
|
|
|
```
|
|
|
|
|
2018-07-20 23:37:57 +00:00
|
|
|
#### With video
|
2018-07-18 23:00:51 +00:00
|
|
|
|
|
|
|
```jsx
|
2018-11-14 18:47:19 +00:00
|
|
|
const mediaItem = {
|
2018-07-18 23:00:51 +00:00
|
|
|
thumbnailObjectUrl: 'https://placekitten.com/76/67',
|
2018-11-14 18:47:19 +00:00
|
|
|
contentType: 'video/mp4',
|
|
|
|
attachment: {
|
|
|
|
fileName: 'foo.jpg',
|
|
|
|
contentType: 'video/mp4',
|
|
|
|
},
|
2018-07-09 21:29:13 +00:00
|
|
|
};
|
2018-11-14 18:47:19 +00:00
|
|
|
<MediaGridItem i18n={util.i18n} mediaItem={mediaItem} />;
|
2018-07-09 21:29:13 +00:00
|
|
|
```
|
|
|
|
|
2018-07-20 23:37:57 +00:00
|
|
|
#### Missing image
|
|
|
|
|
|
|
|
```jsx
|
2018-11-14 18:47:19 +00:00
|
|
|
const mediaItem = {
|
|
|
|
contentType: 'image/jpeg',
|
|
|
|
attachment: {
|
|
|
|
fileName: 'foo.jpg',
|
|
|
|
contentType: 'image/jpeg',
|
|
|
|
},
|
2018-07-20 23:37:57 +00:00
|
|
|
};
|
2018-11-14 18:47:19 +00:00
|
|
|
<MediaGridItem i18n={util.i18n} mediaItem={mediaItem} />;
|
2018-07-20 23:37:57 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Missing video
|
|
|
|
|
|
|
|
```jsx
|
2018-11-14 18:47:19 +00:00
|
|
|
const mediaItem = {
|
|
|
|
contentType: 'video/mp4',
|
|
|
|
attachment: {
|
|
|
|
fileName: 'foo.jpg',
|
|
|
|
contentType: 'video/mp4',
|
|
|
|
},
|
2018-07-20 23:37:57 +00:00
|
|
|
};
|
2018-11-14 18:47:19 +00:00
|
|
|
<MediaGridItem i18n={util.i18n} mediaItem={mediaItem} />;
|
2018-07-20 23:37:57 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Image thumbnail failed to load
|
|
|
|
|
|
|
|
```jsx
|
2018-11-14 18:47:19 +00:00
|
|
|
const mediaItem = {
|
2018-07-20 23:37:57 +00:00
|
|
|
thumbnailObjectUrl: 'nonexistent',
|
2018-11-14 18:47:19 +00:00
|
|
|
contentType: 'image/jpeg',
|
|
|
|
attachment: {
|
|
|
|
fileName: 'foo.jpg',
|
|
|
|
contentType: 'image/jpeg',
|
|
|
|
},
|
2018-07-20 23:37:57 +00:00
|
|
|
};
|
2018-11-14 18:47:19 +00:00
|
|
|
<MediaGridItem i18n={util.i18n} mediaItem={mediaItem} />;
|
2018-07-20 23:37:57 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Video thumbnail failed to load
|
|
|
|
|
|
|
|
```jsx
|
2018-11-14 18:47:19 +00:00
|
|
|
const mediaItem = {
|
2018-07-20 23:37:57 +00:00
|
|
|
thumbnailObjectUrl: 'nonexistent',
|
2018-11-14 18:47:19 +00:00
|
|
|
contentType: 'video/mp4',
|
|
|
|
attachment: {
|
|
|
|
fileName: 'foo.jpg',
|
|
|
|
contentType: 'video/mp4',
|
|
|
|
},
|
2018-07-20 23:37:57 +00:00
|
|
|
};
|
2018-11-14 18:47:19 +00:00
|
|
|
<MediaGridItem i18n={util.i18n} mediaItem={mediaItem} />;
|
2018-07-20 23:37:57 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
#### Other contentType
|
2018-07-09 21:29:13 +00:00
|
|
|
|
|
|
|
```jsx
|
2018-11-14 18:47:19 +00:00
|
|
|
const mediaItem = {
|
|
|
|
contentType: 'application/json',
|
|
|
|
attachment: {
|
|
|
|
fileName: 'foo.jpg',
|
|
|
|
contentType: 'application/json',
|
|
|
|
},
|
2018-07-09 21:29:13 +00:00
|
|
|
};
|
2018-11-14 18:47:19 +00:00
|
|
|
<MediaGridItem i18n={util.i18n} mediaItem={mediaItem} />;
|
2018-07-09 21:29:13 +00:00
|
|
|
```
|