signal-desktop/ts/components/Lightbox.md

62 lines
1.2 KiB
Markdown
Raw Normal View History

## Image (supported format)
2018-04-15 04:27:30 +00:00
```js
const noop = () => {};
<div style={{ position: 'relative', width: '100%', height: 500 }}>
<Lightbox
2018-04-25 22:15:57 +00:00
objectURL="https://placekitten.com/800/600"
contentType="image/jpeg"
onSave={noop}
/>
</div>;
2018-04-15 04:27:30 +00:00
```
## Image (unsupported format)
```js
const noop = () => {};
<div style={{ position: 'relative', width: '100%', height: 500 }}>
<Lightbox objectURL="foo.tif" contentType="image/tiff" onSave={noop} />
</div>;
```
## Video (supported format)
```js
const noop = () => {};
<div style={{ position: 'relative', width: '100%', height: 500 }}>
<Lightbox
objectURL="fixtures/pixabay-Soap-Bubble-7141.mp4"
contentType="video/mp4"
onSave={noop}
/>
</div>;
```
## Video (unsupported format)
```js
const noop = () => {};
<div style={{ position: 'relative', width: '100%', height: 500 }}>
<Lightbox objectURL="foo.mov" contentType="video/quicktime" onSave={noop} />
</div>;
```
## Unsupported file format
```js
const noop = () => {};
<div style={{ position: 'relative', width: '100%', height: 600 }}>
<Lightbox
objectURL="tsconfig.json"
contentType="application/json"
onSave={noop}
/>
</div>;
```