Replace image picker with expo-image-picker (#649)
* Replace image picker with expo-image-picker * Fix cropper & picker on web --------- Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
parent
d5bec4ff37
commit
5f66adc9a6
8 changed files with 51 additions and 46 deletions
|
@ -102,10 +102,14 @@ export class GalleryModel {
|
|||
|
||||
async pick() {
|
||||
const images = await openPicker(this.rootStore, {
|
||||
multiple: true,
|
||||
maxFiles: 4 - this.images.length,
|
||||
selectionLimit: 4 - this.size,
|
||||
allowsMultipleSelection: true,
|
||||
})
|
||||
|
||||
await Promise.all(images.map(image => this.add(image)))
|
||||
return await Promise.all(
|
||||
images.map(image => {
|
||||
this.add(image)
|
||||
}),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -135,7 +135,7 @@ export class ImageModel implements RNImage {
|
|||
// Only for mobile
|
||||
async crop() {
|
||||
try {
|
||||
const cropped = await openCropper(this.rootStore, {
|
||||
const cropped = await openCropper({
|
||||
mediaType: 'photo',
|
||||
path: this.path,
|
||||
freeStyleCropEnabled: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue