-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (27 loc) · 842 Bytes
/
index.js
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
'use strict'
const { NativeModules } = require('react-native');
const { ImagePickerManager } = NativeModules;
const DEFAULT_OPTIONS = {
title: 'Select a Photo',
cancelButtonTitle: 'Cancel',
takePhotoButtonTitle: 'Take Photo…',
chooseFromLibraryButtonTitle: 'Choose from Library…',
quality: 1.0,
allowsEditing: false,
permissionDenied: {
title: 'Permission denied',
text: 'To be able to take pictures with your camera and choose images from your library.',
reTryTitle: 're-try',
okTitle: 'I\'m sure',
}
};
module.exports = {
...ImagePickerManager,
showImagePicker: function showImagePicker(options, callback) {
if (typeof options === 'function') {
callback = options;
options = {};
}
return ImagePickerManager.showImagePicker({...DEFAULT_OPTIONS, ...options}, callback)
}
}