-
Notifications
You must be signed in to change notification settings - Fork 12
/
App.js
46 lines (41 loc) · 1.36 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
import React from 'react';
import {StatusBar} from 'react-native';
import {store, persistor} from '@Store/index';
import {selectTheme} from '@Store/appSlice';
import {Provider, useSelector} from 'react-redux';
import Navigator from '@Src/Views/Navigation/RootNavigator';
import {ApplicationProvider, IconRegistry} from '@ui-kitten/components';
import {PersistGate} from 'redux-persist/integration/react';
import {EvaIconsPack} from '@ui-kitten/eva-icons';
import {mapping, light, dark} from '@eva-design/eva';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {Colors} from '@Theme/Colors';
const darkTheme = {...dark};
const lightTheme = {...light};
const App = () => {
const theme = useSelector(selectTheme);
return (
<SafeAreaProvider>
<StatusBar
barStyle={theme === 'dark' ? 'light-content' : 'dark-content'}
backgroundColor={theme === 'dark' ? Colors.darkMode : Colors.lightMode}
animated={true}
/>
<IconRegistry icons={EvaIconsPack} />
<ApplicationProvider
mapping={mapping}
theme={theme === 'light' ? lightTheme : darkTheme}>
<Navigator />
</ApplicationProvider>
</SafeAreaProvider>
);
};
export default () => {
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
<App />
</PersistGate>
</Provider>
);
};