Expo 57 (#11334)
Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com> Co-authored-by: vineyardbovines <spencerfpope@gmail.com>
This commit is contained in:
@@ -7,15 +7,12 @@ import {
|
||||
useRef,
|
||||
} from 'react'
|
||||
import {View} from 'react-native'
|
||||
import type ViewShot from 'react-native-view-shot'
|
||||
import {type ViewShotRef} from 'react-native-view-shot'
|
||||
|
||||
import {useAvatar} from '#/screens/Onboarding/StepProfile/index'
|
||||
import {atoms as a} from '#/alf'
|
||||
|
||||
const LazyViewShot = lazy(
|
||||
// @ts-expect-error dynamic import
|
||||
() => import('react-native-view-shot/src/index'),
|
||||
)
|
||||
const LazyViewShot = lazy(() => import('react-native-view-shot'))
|
||||
|
||||
const SIZE_MULTIPLIER = 5
|
||||
|
||||
@@ -28,7 +25,7 @@ export interface PlaceholderCanvasRef {
|
||||
export const PlaceholderCanvas = forwardRef<PlaceholderCanvasRef, {}>(
|
||||
function PlaceholderCanvas({}, ref) {
|
||||
const {avatar} = useAvatar()
|
||||
const viewshotRef = useRef<ViewShot>(null)
|
||||
const viewshotRef = useRef<ViewShotRef>(null)
|
||||
const Icon = avatar.placeholder.component
|
||||
|
||||
const styles = useMemo(
|
||||
|
||||
@@ -107,6 +107,7 @@ export function StepProfile() {
|
||||
const response = await sheetWrapper(
|
||||
launchImageLibraryAsync({
|
||||
exif: false,
|
||||
shouldDownloadFromNetwork: true,
|
||||
mediaTypes: ['images'],
|
||||
quality: 1,
|
||||
...opts,
|
||||
|
||||
@@ -95,8 +95,7 @@ export function StepInfo({
|
||||
tldtsRef.current = tldts
|
||||
})
|
||||
// This will get used in the avatar creator a few steps later, so lets preload it now
|
||||
// @ts-expect-error - valid path
|
||||
void import('react-native-view-shot/src/index')
|
||||
void import('react-native-view-shot')
|
||||
}, [])
|
||||
|
||||
const onNextPress = () => {
|
||||
|
||||
Reference in New Issue
Block a user