resolve asset to local URI

This commit is contained in:
Samuel Newman
2026-07-22 16:13:18 +03:00
parent 52cc16d207
commit 83513e2693
+12 -5
View File
@@ -1,5 +1,10 @@
import {useCallback, useEffect, useRef, useState} from 'react' import {useCallback, useEffect, useRef, useState} from 'react'
import {Alert, AppState, type AppStateStatus} from 'react-native' import {
Alert,
AppState,
Image as RNImage,
type AppStateStatus,
} from 'react-native'
import {nativeBuildVersion} from 'expo-application' import {nativeBuildVersion} from 'expo-application'
import { import {
checkForUpdateAsync, checkForUpdateAsync,
@@ -448,14 +453,16 @@ export function useOTAUpdates() {
* Splash screen for while the app is updating * Splash screen for while the app is updating
*/ */
export const splash = (scheme: 'light' | 'dark') => { export const splash = (scheme: 'light' | 'dark') => {
return { const source =
image:
scheme === 'light' scheme === 'light'
? require('../../../assets/splash/splash.png') ? require('../../../assets/splash/splash.png')
: require('../../../assets/splash/splash-dark.png'), : require('../../../assets/splash/splash-dark.png')
return {
image: RNImage.resolveAssetSource(source).uri,
imageFullScreen: true, imageFullScreen: true,
imageResizeMode: 'cover', imageResizeMode: 'cover',
backgroundColor: scheme === 'light' ? '#0c7cff' : '#0c2a49', backgroundColor: scheme === 'light' ? '#006AFF' : '#002861',
spinner: { spinner: {
enabled: true, enabled: true,
color: '#ffffff', color: '#ffffff',