-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.tsx
36 lines (29 loc) · 1.21 KB
/
App.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import RNToast, { ToastShowParams } from 'react-native-toast-message';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import * as SplashScreen from 'expo-splash-screen';
import { Toast } from '@/components';
import { ThemeProvider } from '@/contexts/ThemeContext';
import { UserProvider } from '@/contexts/UserContext';
import Navigation from '@/navigation';
SplashScreen.preventAutoHideAsync();
export default function App() {
const toastConfig = {
success: ({ props }: ToastShowParams) => <Toast variant="success" {...props} />,
error: ({ props }: ToastShowParams) => <Toast variant="error" {...props} />,
warning: ({ props }: ToastShowParams) => <Toast variant="warning" {...props} />,
info: ({ props }: ToastShowParams) => <Toast variant="info" {...props} />,
};
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<UserProvider>
<ThemeProvider>
<BottomSheetModalProvider>
<Navigation />
<RNToast config={toastConfig} topOffset={64} />
</BottomSheetModalProvider>
</ThemeProvider>
</UserProvider>
</GestureHandlerRootView>
);
}