-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
81 lines (75 loc) · 2.11 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import React, { useEffect } from 'react';
import { Provider as PaperProvider, DefaultTheme, configureFonts } from 'react-native-paper';
import * as SplashScreen from 'expo-splash-screen';
import { useFonts } from 'expo-font';
import Loading from './src/components/Loading';
import { Provider } from 'react-redux';
import store, { persistor } from './src/redux/store';
import { PersistGate } from 'redux-persist/integration/react';
import AppNavigator from './src/components/NavigationContainer';
SplashScreen.preventAutoHideAsync();
export default function App() {
// Load fonts using `expo-font`
const [fontsLoaded] = useFonts({
'Roboto-Regular': require('./assets/fonts/Roboto-Regular.ttf'),
'Roboto-Bold': require('./assets/fonts/Roboto-Bold.ttf'),
'Roboto-Italic': require('./assets/fonts/Roboto-Italic.ttf'),
});
useEffect(() => {
if (fontsLoaded) {
SplashScreen.hideAsync();
}
}, [fontsLoaded]);
// Font configuration
const fontConfig = {
default: {
regular: {
fontFamily: 'Roboto-Regular',
fontWeight: 'normal',
},
medium: {
fontFamily: 'Roboto-Bold',
fontWeight: 'normal',
},
light: {
fontFamily: 'Roboto-Italic',
fontWeight: 'normal',
},
thin: {
fontFamily: 'Roboto-Italic',
fontWeight: 'normal',
},
bodySmall: {
fontFamily: 'Roboto-Regular',
fontWeight: 'normal',
},
bodyMedium: {
fontFamily: 'Roboto-Regular',
fontWeight: 'normal',
},
},
};
const theme = {
...DefaultTheme,
fonts: configureFonts(fontConfig),
roundness: 8, // Optional: Rounded corners for UI elements
colors: {
...DefaultTheme.colors,
primary: '#F44336', // Use your red palette here
accent: '#FFCDD2',
},
};
return (
<Provider store={store}>
<PersistGate loading={null} persistor={persistor}>
{!fontsLoaded ? (
<Loading />
) : (
<PaperProvider theme={theme}>
<AppNavigator />
</PaperProvider>
)}
</PersistGate>
</Provider>
);
}