Fix openCamera, openCropped, lightbox model, and image model usages (#1908)
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import {RootStoreModel} from 'state/index'
|
||||
import {Image as RNImage} from 'react-native-image-crop-picker'
|
||||
import RNFS from 'react-native-fs'
|
||||
import {CropperOptions} from './types'
|
||||
@@ -22,18 +21,15 @@ async function getFile() {
|
||||
})
|
||||
}
|
||||
|
||||
export async function openPicker(_store: RootStoreModel): Promise<RNImage[]> {
|
||||
export async function openPicker(): Promise<RNImage[]> {
|
||||
return [await getFile()]
|
||||
}
|
||||
|
||||
export async function openCamera(_store: RootStoreModel): Promise<RNImage> {
|
||||
export async function openCamera(): Promise<RNImage> {
|
||||
return await getFile()
|
||||
}
|
||||
|
||||
export async function openCropper(
|
||||
_store: RootStoreModel,
|
||||
opts: CropperOptions,
|
||||
): Promise<RNImage> {
|
||||
export async function openCropper(opts: CropperOptions): Promise<RNImage> {
|
||||
return {
|
||||
path: opts.path,
|
||||
mime: 'image/jpeg',
|
||||
|
||||
@@ -6,15 +6,6 @@ import {
|
||||
import {CameraOpts, CropperOptions} from './types'
|
||||
export {openPicker} from './picker.shared'
|
||||
|
||||
/**
|
||||
* NOTE
|
||||
* These methods all include the RootStoreModel as the first param
|
||||
* because the web versions require it. The signatures have to remain
|
||||
* equivalent between the different forms, but the store param is not
|
||||
* used here.
|
||||
* -prf
|
||||
*/
|
||||
|
||||
export async function openCamera(opts: CameraOpts): Promise<RNImage> {
|
||||
const item = await openCameraFn({
|
||||
width: opts.width,
|
||||
|
||||
Reference in New Issue
Block a user