-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
49 lines (47 loc) · 1.23 KB
/
App.js
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
import React from 'react';
import MainNavigation from './src/navigations';
import {useColorScheme} from 'react-native';
import {DefaultTheme, Provider as PaperProvider} from 'react-native-paper';
import {NavigationContainer} from '@react-navigation/native';
import {Provider} from 'react-redux';
import store from './src/redux/store';
import {UserProvider} from './src/contexts/UserContext';
import {ProductProvider} from './src/contexts/ProductContext';
const darkTheme = {
...DefaultTheme,
roundness: 2,
colors: {
...DefaultTheme.colors,
primary: '#D45555',
accent: '#fff',
text: '#fff',
textSub: '#e5e5e5',
background: '#000',
},
};
const lightTheme = {
...DefaultTheme,
roundness: 2,
colors: {
...DefaultTheme.colors,
primary: '#D45555',
background: '#fff',
},
};
const App = () => {
const scheme = useColorScheme();
return (
<UserProvider>
<ProductProvider>
<PaperProvider theme={scheme === 'dark' ? darkTheme : lightTheme}>
<Provider store={store}>
<NavigationContainer>
<MainNavigation />
</NavigationContainer>
</Provider>
</PaperProvider>
</ProductProvider>
</UserProvider>
);
};
export default App;