|
1 |
| -import React, { PureComponent } from 'react'; |
| 1 | +import React from 'react'; |
2 | 2 |
|
3 | 3 | import Gallery from '../../src/react-chayns-gallery/component/Gallery';
|
| 4 | +import Image from '../../src/react-chayns-gallery/component/Image'; |
| 5 | +import ImageContainer from '../../src/react-chayns-gallery/component/ImageContainer'; |
4 | 6 |
|
5 |
| -export default class GalleryExample extends PureComponent { |
6 |
| - render() { |
7 |
| - const images = [ |
8 |
| - { |
9 |
| - url: 'https://tsimg.cloud/127-89061/9d6979d3ac95a053c532f86af9acfb5af9262020.jpg', |
10 |
| - preview: '/9j/2wBDAFA3PEY8MlBGQUZaVVBfeMiCeG5uePWvuZHI////////////////////////////////////////////////////2wBDAVVaWnhpeOuCguv/////////////////////////////////////////////////////////////////////////wAARCAAoADwDASIAAhEBAxEB/8QAGAABAQEBAQAAAAAAAAAAAAAAAgABAwT/xAAjEAEAAwABBQABBQAAAAAAAAABAAIRIQMSMUFRgSJCYWKx/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAGBEBAQEBAQAAAAAAAAAAAAAAABEBMVH/2gAMAwEAAhEDEQA/APN2JVc4mViOo9oewyb0qi8+DlgOleQzl+zerRDN9h4iAd4y3khFbnd6fEjXAek+mFMvzPStV7ahv+Tj1acNh3PMUnira1Hh5Zyva1rKvMlcyGVlpOlDZzBDfUdHIM674mBZ5++oba2NR/tFU7jfnr7Le67hmASNIUM7T8MzqNu12mGRGVWr5/awdS36f5eJBxSGJMhmmSrxXfktV3dlKTDXSt3znP2bXqZZsvuUpYUep1C3g/MDbXXllKIWsXXmGUoH/9k=', |
11 |
| - width: 640, |
12 |
| - height: 426, |
13 |
| - }, |
14 |
| - { |
15 |
| - url: 'https://tsimg.cloud/127-89061/2b83dfa29f2f88bcb35372cbfbefe04a3f899d00.jpg', |
16 |
| - preview: '/9j/2wBDAFA3PEY8MlBGQUZaVVBfeMiCeG5uePWvuZHI////////////////////////////////////////////////////2wBDAVVaWnhpeOuCguv/////////////////////////////////////////////////////////////////////////wAARCAAoABsDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAECAwT/xAAgEAEAAwABBQADAAAAAAAAAAABAAIRIRIxQVFhAzKh/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAAMAAAAAAAAAAAAAAAAAAAERIf/aAAwDAQACEQMRAD8A06V9Qy3qD0j+5KpYHuQqqCHJHueIFyxw6SFdgcoJyYx7YrnSb88ydfMuhtjiZ0KtUrm/2GfYrKWfUW/YuQOVOebepf41bdT3yEJQrZrWz3eH1MksOdLCED//2Q==', |
17 |
| - }, |
18 |
| - { |
19 |
| - url: 'https://tsimg.cloud/72975-12914/e087202f5badd652fd015d39df83c35065941fe5.png', |
20 |
| - }, |
21 |
| - { |
22 |
| - url: 'https://tsimg.space/v1/images/6ffbd340-a77b-e811-80d6-0025905a8161.jpg', |
23 |
| - }, |
24 |
| - { |
25 |
| - url: 'https://tsimg.space/v1/images/59a25b31-3997-e811-80d6-0025905a8161.jpg', |
26 |
| - width: 500, |
27 |
| - height: 300, |
28 |
| - } |
29 |
| - ]; |
| 7 | +export default function GalleryExample() { |
| 8 | + const images = ['https://tsimg.cloud/127-89061/9d6979d3ac95a053c532f86af9acfb5af9262020.jpg', |
| 9 | + 'https://tsimg.cloud/127-89061/2b83dfa29f2f88bcb35372cbfbefe04a3f899d00.jpg', |
| 10 | + 'https://tsimg.cloud/72975-12914/e087202f5badd652fd015d39df83c35065941fe5.png', |
| 11 | + 'https://tsimg.space/v1/images/6ffbd340-a77b-e811-80d6-0025905a8161.jpg', |
| 12 | + 'https://tsimg.space/v1/images/59a25b31-3997-e811-80d6-0025905a8161.jpg', |
| 13 | + 'https://tsimg.space/v1/images/59a25b31-3997-e811-80d6-0025905a8161.jpg', |
| 14 | + ]; |
30 | 15 |
|
31 |
| - return ( |
32 |
| - <div> |
33 |
| - <h3>5 images, different imageServices, 2 with preview</h3> |
34 |
| - <Gallery style={{ marginBottom: '30px' }} images={images}/> |
35 |
| - <h3>4 images, different imageServices, 2 with preview, height 300px</h3> |
36 |
| - <Gallery |
37 |
| - style={{ marginBottom: '30px' }} |
38 |
| - images={[images[1], images[2], images[3], images[4]]} |
39 |
| - height={300} |
| 16 | + return ( |
| 17 | + <div> |
| 18 | + <h3>Gallery-Component</h3> |
| 19 | + <Gallery |
| 20 | + style={{ marginBottom: '30px' }} |
| 21 | + images={images} |
| 22 | + /> |
| 23 | + <Gallery |
| 24 | + style={{ marginBottom: '30px' }} |
| 25 | + images={[images[0], images[1], images[2], images[3], images[4]]} |
| 26 | + /> |
| 27 | + <Gallery |
| 28 | + style={{ marginBottom: '30px' }} |
| 29 | + images={[images[0], images[1], images[2], images[3]]} |
| 30 | + /> |
| 31 | + <Gallery |
| 32 | + style={{ marginBottom: '30px' }} |
| 33 | + images={[images[0], images[1], images[2]]} |
| 34 | + /> |
| 35 | + <Gallery |
| 36 | + style={{ marginBottom: '30px' }} |
| 37 | + images={[images[0], images[1]]} |
| 38 | + /> |
| 39 | + <Gallery |
| 40 | + style={{ marginBottom: '30px' }} |
| 41 | + images={[images[0]]} |
| 42 | + /> |
| 43 | + <h3>Image-Component</h3> |
| 44 | + <Image |
| 45 | + image={images[0]} |
| 46 | + onClick={console.log} |
| 47 | + style={{ width: '100px', height: '100px', marginBottom: '30px' }} |
| 48 | + styleLandscape={{ borderRadius: '10px' }} |
| 49 | + stylePortrait={{ border: '3px solid black' }} |
| 50 | + /> |
| 51 | + <h3>ImageContainer-Component</h3> |
| 52 | + <ImageContainer |
| 53 | + tools={[ |
| 54 | + { icon: 'ts-tobit', onClick: console.log }, |
| 55 | + { icon: 'ts-wrong', onClick: console.log }, |
| 56 | + { icon: 'ts-check', onClick: console.log }, |
| 57 | + ]} |
| 58 | + style={{ marginBottom: '30px' }} |
| 59 | + > |
| 60 | + <Image |
| 61 | + image={images[0]} |
| 62 | + onClick={console.log} |
40 | 63 | />
|
41 |
| - <h3>3 images, 2 with preview, width 200px</h3> |
42 |
| - <Gallery style={{ marginBottom: '30px' }} images={[images[1], images[2], images[3]]} width={200}/> |
43 |
| - <h3>2 images with preview</h3> |
44 |
| - <Gallery style={{ marginBottom: '30px' }} images={[images[2], images[4]]}/> |
45 |
| - <h3>1 image with preview</h3> |
46 |
| - <Gallery style={{ marginBottom: '30px' }} images={[images[1]]}/> |
47 |
| - <h3>1 image, height 300px</h3> |
48 |
| - <Gallery style={{ marginBottom: '30px' }} images={[images[4]]} height={300}/> |
49 |
| - </div> |
50 |
| - ); |
51 |
| - } |
| 64 | + </ImageContainer> |
| 65 | + </div> |
| 66 | + ); |
52 | 67 | }
|
0 commit comments