Fix openCamera, openCropped, lightbox model, and image model usages (#1908)

This commit is contained in:
Eric Bailey 2023-11-14 19:46:46 -06:00 committed by GitHub
parent 7d5e01f433
commit ab1ce078ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 34 deletions

View file

@ -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',

View file

@ -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,