: notifikasi in app Deskripsi: - package baru - menampilkan notifikasi saat sedang membuka app NoIssues
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import AuthProvider from '@/providers/AuthProvider';
|
|
import { useFonts } from 'expo-font';
|
|
import { Stack } from 'expo-router';
|
|
import * as SplashScreen from 'expo-splash-screen';
|
|
import { StatusBar } from 'expo-status-bar';
|
|
import { useEffect } from 'react';
|
|
import 'react-native-reanimated';
|
|
import { NotifierWrapper } from 'react-native-notifier';
|
|
import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
|
|
|
// Prevent the splash screen from auto-hiding before asset loading is complete.
|
|
SplashScreen.preventAutoHideAsync();
|
|
|
|
export default function RootLayout() {
|
|
const [loaded] = useFonts({
|
|
SpaceMono: require('../assets/fonts/SpaceMono-Regular.ttf'),
|
|
});
|
|
|
|
useEffect(() => {
|
|
if (loaded) {
|
|
SplashScreen.hideAsync();
|
|
}
|
|
}, [loaded]);
|
|
|
|
if (!loaded) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<GestureHandlerRootView style={{ flex: 1 }}>
|
|
<NotifierWrapper>
|
|
<AuthProvider>
|
|
<Stack>
|
|
<Stack.Screen name="index" options={{ headerShown: false }} />
|
|
<Stack.Screen name="verification" options={{ headerShown: false }} />
|
|
<Stack.Screen name="(application)" options={{ headerShown: false }} />
|
|
</Stack>
|
|
<StatusBar style="auto" />
|
|
</AuthProvider>
|
|
</NotifierWrapper>
|
|
</GestureHandlerRootView>
|
|
);
|
|
}
|