-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.jsx
55 lines (51 loc) · 1.28 KB
/
App.jsx
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React, {useEffect} from 'react';
import {StatusBar} from 'react-native';
import Toast, {BaseToast, ErrorToast} from 'react-native-toast-message';
import SplashScreen from 'react-native-splash-screen';
// components
import DataContextProvider from './src/context/DataContext';
import Router from './src/routes/Router';
import SearchContextProvider from './src/context/SearchContext';
const toastConfig = {
success: props => (
<BaseToast
{...props}
style={{borderLeftColor: '#6FD09A', width: '90%'}}
contentContainerStyle={{paddingHorizontal: 15}}
text1Style={{
fontSize: 15,
fontWeight: '400',
}}
text1NumberOfLines={3}
/>
),
error: props => (
<ErrorToast
{...props}
style={{borderLeftColor: '#FF4C00', width: '90%'}}
contentContainerStyle={{paddingHorizontal: 15}}
text1Style={{
fontSize: 15,
fontWeight: '400',
}}
text1NumberOfLines={3}
/>
),
};
const App = () => {
useEffect(() => {
SplashScreen.hide();
}, []);
return (
<>
<StatusBar />
<DataContextProvider>
<SearchContextProvider>
<Router />
</SearchContextProvider>
</DataContextProvider>
<Toast config={toastConfig} />
</>
);
};
export default App;