mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at rn-stack-repro 28 lines 709 B view raw
1import { 2 ImagePickerOptions, 3 launchImageLibraryAsync, 4 MediaTypeOptions, 5} from 'expo-image-picker' 6import {getDataUriSize} from './util' 7import * as Toast from 'view/com/util/Toast' 8 9export async function openPicker(opts?: ImagePickerOptions) { 10 const response = await launchImageLibraryAsync({ 11 exif: false, 12 mediaTypes: MediaTypeOptions.Images, 13 quality: 1, 14 ...opts, 15 }) 16 17 if (response.assets && response.assets.length > 4) { 18 Toast.show('You may only select up to 4 images') 19 } 20 21 return (response.assets ?? []).slice(0, 4).map(image => ({ 22 mime: 'image/jpeg', 23 height: image.height, 24 width: image.width, 25 path: image.uri, 26 size: getDataUriSize(image.uri), 27 })) 28}