-
Notifications
You must be signed in to change notification settings - Fork 6
/
App.tsx
106 lines (98 loc) · 2.9 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
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import React, { useEffect } from 'react';
// Components
import { StatusBar } from 'react-native';
import { ThemeProvider } from 'react-native-paper';
import MainNavigator from './src/navigation/MainNavigator';
import { RNIAPCallbacks } from './src/screens/lessons';
import SplashScreen from 'react-native-splash-screen';
// Redux
import { Provider } from 'react-redux';
import { loadInitialData } from './src/redux/actions';
// Utilities
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { theme } from './src/styles/theme';
// Redux
import { store } from './src/redux/store';
/* eslint-disable @typescript-eslint/consistent-type-definitions */
declare global {
/* eslint-disable-next-line @typescript-eslint/no-namespace */
namespace ReactNativePaper {
interface ThemeColors {
// primary: string;
// background: string;
// surface: string;
// accent: string;
// error: string;
// text: string;
// placeholder: string;
onPrimary: string;
dark: string;
light: string;
}
// interface ThemeFont {
// fontWeight: 'normal'
// | 'bold'
// | '100'
// | '200'
// | '300'
// | '400'
// | '500'
// | '600'
// | '700'
// | '800'
// | '900';
// }
interface ThemeFonts {
semiBold: ThemeFont;
}
interface Theme {
sizes: {
xSmall: number;
small: number;
medium: number;
large: number;
xLarge: number;
jumbo: number;
};
spaces: {
xSmall: number;
small: number;
medium: number;
large: number;
xLarge: number;
jumbo: number;
};
fontSizes: {
10: number;
12: number;
14: number;
16: number;
18: number;
20: number;
24: number;
34: number;
48: number;
60: number;
96: number;
};
}
}
}
/* eslint-enable @typescript-eslint/consistent-type-definitions */
export const App: React.FC = () => {
useEffect((): void => {
SplashScreen.hide();
StatusBar.setBarStyle('light-content', true);
store.dispatch(loadInitialData());
}, []);
return (
<Provider store={store}>
<SafeAreaProvider>
<ThemeProvider theme={theme}>
<RNIAPCallbacks />
<MainNavigator enableURLHandling={false} />
</ThemeProvider>
</SafeAreaProvider>
</Provider>
);
};