Kantongku: splash screen (logo teal + background gradient)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { StatusBar } from 'expo-status-bar';
|
||||
import * as SplashScreen from 'expo-splash-screen';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { ActivityIndicator, StyleSheet, Text, View } from 'react-native';
|
||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||
@@ -8,6 +9,8 @@ import { checkRecurringDue, getSetting } from './src/db/repositories';
|
||||
import { RootNavigator } from './src/navigation';
|
||||
import { colors } from './src/theme/colors';
|
||||
|
||||
SplashScreen.preventAutoHideAsync().catch(() => {});
|
||||
|
||||
export default function App() {
|
||||
const [ready, setReady] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -25,6 +28,7 @@ export default function App() {
|
||||
const onboarded = await getSetting('onboarded');
|
||||
setInitialRoute(onboarded === '1' ? 'Main' : 'Onboarding');
|
||||
setReady(true);
|
||||
SplashScreen.hideAsync().catch(() => {});
|
||||
})
|
||||
.catch((e) => setError(String(e)));
|
||||
}, []);
|
||||
|
||||
Reference in New Issue
Block a user