-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.tsx
56 lines (50 loc) · 1.33 KB
/
App.tsx
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
import {
DefaultTheme,
NavigationContainer,
Theme,
} from '@react-navigation/native';
import React from 'react';
import { SafeAreaView, StatusBar, useColorScheme } from 'react-native';
import {
DefaultTheme as PaperDefaultTheme,
PaperProvider,
} from 'react-native-paper';
import { Colors } from 'react-native/Libraries/NewAppScreen';
import { CONSTANTS } from './src/configs/constants';
import Routes from './src/routes';
import { generateFakeUsersData } from './src/shared/server';
generateFakeUsersData();
export function App() {
const scheme = useColorScheme();
const navCustomDarkTheme: Theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: CONSTANTS.BG_COLOR,
background: Colors.rebeccapurple,
},
};
const paperTheme = {
...PaperDefaultTheme,
dark: scheme === 'dark',
colors: {
...PaperDefaultTheme.colors,
primary: CONSTANTS.BG_COLOR,
},
};
return (
<SafeAreaView style={{flex: 1}}>
<NavigationContainer
theme={scheme === 'dark' ? navCustomDarkTheme : DefaultTheme}>
<StatusBar
animated
barStyle="default"
backgroundColor={CONSTANTS.BG_COLOR}
/>
<PaperProvider theme={paperTheme}>
<Routes />
</PaperProvider>
</NavigationContainer>
</SafeAreaView>
);
}