-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathindex.android.js
More file actions
38 lines (33 loc) · 747 Bytes
/
index.android.js
File metadata and controls
38 lines (33 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import {NativeModules} from "react-native";
const {IGImagePicker} = NativeModules;
const defaultOption = {
showCamera: true,
videoSinglePick: false,
singlePickWithAutoComplete: false,
imageOnly: false,
videoOnly: false,
maxCount: 5,
columnCount: 4
};
export const showImagePicker = (options = {}) => {
return IGImagePicker.openPicker({...defaultOption, ...options});
};
export const libaryPicker = options => {
return IGImagePicker.openPicker({
...defaultOption,
...options,
imageOnly: true
});
};
export const videoPicker = options => {
return IGImagePicker.openPicker({
...defaultOption,
...options,
videoOnly: true
});
};
export default {
showImagePicker,
libaryPicker,
videoPicker
};