-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
57 lines (46 loc) · 1.29 KB
/
App.js
File metadata and controls
57 lines (46 loc) · 1.29 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
46
47
48
49
50
51
52
53
54
55
56
57
import React, { useEffect } from 'react';
import { View, ActivityIndicator } from 'react-native';
import {
NavigationContainer,
DefaultTheme as NavigationDefaultTheme,
DarkTheme as NavigationDarkTheme
} from '@react-navigation/native';
import { createDrawerNavigator } from '@react-navigation/drawer';
import {
Provider as PaperProvider,
DefaultTheme as PaperDefaultTheme,
DarkTheme as PaperDarkTheme
} from 'react-native-paper';
import RootStackScreen from './src/Screens/RootStackScreen';
const App = () => {
const [isDarkTheme, setIsDarkTheme] = React.useState(false);
const CustomDefaultTheme = {
...NavigationDefaultTheme,
...PaperDefaultTheme,
colors: {
...NavigationDefaultTheme.colors,
...PaperDefaultTheme.colors,
background: '#ffffff',
text: '#333333'
}
}
const CustomDarkTheme = {
...NavigationDarkTheme,
...PaperDarkTheme,
colors: {
...NavigationDarkTheme.colors,
...PaperDarkTheme.colors,
background: '#333333',
text: '#ffffff'
}
}
const theme = isDarkTheme ? CustomDarkTheme : CustomDefaultTheme;
return (
<PaperProvider theme={theme}>
<NavigationContainer theme={theme}>
<RootStackScreen/>
</NavigationContainer>
</PaperProvider>
);
}
export default App;