@@ -24,14 +24,12 @@ A React Native component to display a gallery of images.
24
24
25
25
#### iOS
26
26
27
- 1 . In Xcode, in the project navigator, right click ` Libraries ` ➜ `Add Files to
28
- [ your project's name] `
29
- 2 . Go to ` node_modules ` ➜ ` react-native-interactive-image-gallery ` and add
30
- ` RNIKInteractiveImageLibrary.xcodeproj `
31
- 3 . In XCode, in the project navigator, select your project. Add
32
- ` libRNIKInteractiveImageLibrary.a ` to your project's ` Build Phases ` ➜ `Link
33
- Binary With Libraries`
34
- 4 . Run your project (` Cmd+R ` )<
27
+ 1 . In Xcode, in the project navigator, right click ` Libraries ` ➜ ` Add Files to [your project's name] `
28
+ 2 . Go to ` node_modules ` ➜ ` react-native-interactive-image-gallery ` and add
29
+ ` RNIKInteractiveImageLibrary.xcodeproj `
30
+ 3 . In XCode, in the project navigator, select your project. Add
31
+ ` libRNIKInteractiveImageLibrary.a ` to your project's ` Build Phases ` ➜ ` Link Binary With Libraries `
32
+ 4 . Run your project (` Cmd+R ` )<
35
33
36
34
#### Android
37
35
@@ -40,27 +38,51 @@ No additional setup needed.
40
38
## Usage
41
39
42
40
``` javascript
43
- import ImageBrowser from ' react-native-interactive-image-gallery' ;
41
+ import ImageBrowser from ' react-native-interactive-image-gallery'
44
42
45
43
class Images extends React .PureComponent < Props> {
46
44
render () {
47
45
const imageURLs: Array <Object > = this .props .images .map (
48
46
(img : Object , index : number ) => ({
49
47
URI : img .uri ,
48
+ thumbnail: img .thumbnail ,
50
49
id: String (index),
51
50
title: img .title ,
52
51
description: img .description
53
52
})
54
- );
55
- return < ImageBrowser images= {imageURLs} / > ;
53
+ )
54
+ return < ImageBrowser images= {imageURLs} / >
56
55
}
57
56
}
58
57
```
59
58
60
59
## API
61
60
62
- Work in progress 🚧👷🏻. Some features are experimental and the API will change in
63
- the future.
61
+ The ` <ImageBrowser /> ` component accepts the following props
62
+
63
+ ### Props
64
+
65
+ | Prop | Type | Mandatory |
66
+ | ------------------------------------- | --------------------- | --------- |
67
+ | ` images ` | ` Array<ImageSource> ` | ** Yes** |
68
+ | ` onPressImage ` | ` Function ` |
69
+ | ` topMargin ` | ` number ` |
70
+ | ` closeText ` | ` string ` |
71
+ | ` infoTitleStyles ` | ` Animated.View.style ` |
72
+ | ` infoDescriptionStyles ` | ` Animated.View.style ` |
73
+ | ` enableTilt ` (experimental, iOS only) | ` boolean ` |
74
+
75
+ Where ` ImageSource ` represents
76
+
77
+ ### ` ImageSource `
78
+
79
+ | Name | Type | Mandatory |
80
+ | ------------- | -------- | --------- |
81
+ | ` id ` | ` string ` | ** Yes** |
82
+ | ` URI ` | ` string ` | ** Yes** |
83
+ | ` thumbnail ` | ` string ` | ** Yes** |
84
+ | ` title ` | ` string ` |
85
+ | ` description ` | ` string ` |
64
86
65
87
## Aknowledgements
66
88
0 commit comments