This repository was archived by the owner on Mar 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
45 lines (40 loc) · 1.32 KB
/
index.js
File metadata and controls
45 lines (40 loc) · 1.32 KB
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
// DO NOT MOVE
// react - native - gesture - handler must be the first import in the entry file.
import 'react-native-gesture-handler';
import React from 'react';
import { AppRegistry, Platform, StatusBar } from 'react-native';
import App from './src/features/App';
import { name as appName } from './app.json';
import {
Provider as PaperProvider,
DarkTheme,
DefaultTheme,
} from 'react-native-paper';
import { useColorScheme } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { Provider as ReduxProvider } from 'react-redux';
import store from './src/store';
const Main = () => {
const colorScheme = useColorScheme();
const theme = colorScheme === 'dark' ? DarkTheme : DefaultTheme;
let barStyle;
if (Platform.OS === 'ios') {
barStyle = colorScheme === 'dark' ? 'dark-content' : 'light-content';
} else {
barStyle = colorScheme === 'dark' ? 'light-content' : 'dark-content';
}
return (
<PaperProvider theme={theme}>
<NavigationContainer theme={theme}>
<ReduxProvider store={store}>
<StatusBar
barStyle={barStyle}
backgroundColor={theme.colors.background}
/>
<App />
</ReduxProvider>
</NavigationContainer>
</PaperProvider>
);
};
AppRegistry.registerComponent(appName, () => Main);