Add web polyfills
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
openPicker,
|
||||
openCamera,
|
||||
openCropper,
|
||||
} from 'react-native-image-crop-picker'
|
||||
} from '../util/images/ImageCropPicker'
|
||||
import {
|
||||
UserLocalPhotosModel,
|
||||
PhotoIdentifier,
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from 'react-native'
|
||||
import LinearGradient from 'react-native-linear-gradient'
|
||||
import {BottomSheetScrollView, BottomSheetTextInput} from '@gorhom/bottom-sheet'
|
||||
import {Image as PickedImage} from 'react-native-image-crop-picker'
|
||||
import {Image as PickedImage} from '../util/images/ImageCropPicker'
|
||||
import {Text} from '../util/text/Text'
|
||||
import {ErrorMessage} from '../util/error/ErrorMessage'
|
||||
import {useStores} from '../../../state'
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
openCropper,
|
||||
openPicker,
|
||||
Image as PickedImage,
|
||||
} from 'react-native-image-crop-picker'
|
||||
} from './images/ImageCropPicker'
|
||||
import {colors, gradients} from '../../lib/styles'
|
||||
|
||||
export function UserAvatar({
|
||||
|
||||
@@ -2,13 +2,9 @@ import React, {useCallback} from 'react'
|
||||
import {StyleSheet, View, TouchableOpacity, Alert, Image} from 'react-native'
|
||||
import Svg, {Rect, Defs, LinearGradient, Stop} from 'react-native-svg'
|
||||
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
|
||||
import {Image as PickedImage} from 'react-native-image-crop-picker'
|
||||
import {Image as PickedImage} from './images/ImageCropPicker'
|
||||
import {colors, gradients} from '../../lib/styles'
|
||||
import {
|
||||
openCamera,
|
||||
openCropper,
|
||||
openPicker,
|
||||
} from 'react-native-image-crop-picker'
|
||||
import {openCamera, openCropper, openPicker} from './images/ImageCropPicker'
|
||||
|
||||
export function UserBanner({
|
||||
banner,
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
export {
|
||||
openPicker,
|
||||
openCamera,
|
||||
openCropper,
|
||||
} from 'react-native-image-crop-picker'
|
||||
export type {Image} from 'react-native-image-crop-picker'
|
||||
@@ -0,0 +1,32 @@
|
||||
import type {
|
||||
Image,
|
||||
Video,
|
||||
ImageOrVideo,
|
||||
Options,
|
||||
PossibleArray,
|
||||
} from 'react-native-image-crop-picker'
|
||||
|
||||
export type {Image} from 'react-native-image-crop-picker'
|
||||
|
||||
type MediaType<O> = O extends {mediaType: 'photo'}
|
||||
? Image
|
||||
: O extends {mediaType: 'video'}
|
||||
? Video
|
||||
: ImageOrVideo
|
||||
|
||||
export async function openPicker<O extends Options>(
|
||||
_options: O,
|
||||
): Promise<PossibleArray<O, MediaType<O>>> {
|
||||
// TODO
|
||||
throw new Error('TODO')
|
||||
}
|
||||
export async function openCamera<O extends Options>(
|
||||
_options: O,
|
||||
): Promise<PossibleArray<O, MediaType<O>>> {
|
||||
// TODO
|
||||
throw new Error('TODO')
|
||||
}
|
||||
export async function openCropper(_options: Options): Promise<Image> {
|
||||
// TODO
|
||||
throw new Error('TODO')
|
||||
}
|
||||
Reference in New Issue
Block a user