-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
90 lines (82 loc) · 2.44 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
82
83
84
85
86
87
88
89
90
import React, { useEffect, useState } from "react";
import * as Expo from 'expo';
import * as Font from 'expo-font';
import { Provider as StateProvider } from 'react-redux';
import { Provider as PaperProvider, DefaultTheme } from "react-native-paper";
import { PersistGate } from 'redux-persist/integration/react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { getStore, getPersistor } from './src/lib/configureStore';
import Main from './src/routes';
const defaultTheme = {
...DefaultTheme,
colors: {
// Primary = Light Blue 500
// Secondary = Deep Purple A 200
...DefaultTheme.colors,
primary: '#03A9F4',
onPrimay: '#000000',
primaryLight: '#67DAFF',
onPrimaryLight: '#000000',
primaryDark: '#007AC1',
onPrimaryDark: '#000000',
accent: '#7C4DFF',
onAccent: '#FFFFFF',
accentLight: '#B47CFF',
onAccentLight: '#000000',
accentDark: '#3F1DCB',
onAccentDark: '#FFFFFF',
background: '#E2E3E2',
onBackground: '#000000',
surface: '#F5F5F5',
onSurface: '#000000',
text: '#000000',
// Blue Grey 300
outline: '#90a4ae'
// disabled: '#FF0000',
// placeholder: '#',
// backdrop: '#E2E3E2',
},
fonts: {
regular: {
fontFamily: 'WorkSans-Regular',
fontWeight: '400',
},
medium: {
fontFamily: 'WorkSans-Medium',
},
light: {
fontFamily: 'WorkSans-Light',
},
thin: {
fontFamily: 'WorkSans-Thin',
},
},
};
const App = () => {
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
Font.loadAsync({
'Courier': require('./assets/fonts/Courier-Regular.ttf'),
'Courier-Bold': require('./assets/fonts/Courier-BoldRegular.ttf'),
'WorkSans-Regular': require('./assets/fonts/WorkSans-VariableFont_wght.ttf'),
'WorkSans-Medium': require('./assets/fonts/WorkSans-Medium.ttf'),
'WorkSans-Light': require('./assets/fonts/WorkSans-Light.ttf'),
'WorkSans-Thin': require('./assets/fonts/WorkSans-Thin.ttf'),
}).then(() => setIsLoading(false));
}, []);
if (isLoading) {
return <Expo.AppLoading />
}
return (
<SafeAreaProvider>
<StateProvider store={getStore()}>
<PersistGate persistor={getPersistor()} loading={<Expo.AppLoading />}>
<PaperProvider theme={defaultTheme}>
<Main />
</PaperProvider>
</PersistGate>
</StateProvider>
</SafeAreaProvider>
);
};
export default App;