-
Notifications
You must be signed in to change notification settings - Fork 1
/
App.tsx
59 lines (55 loc) · 1.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
import { NavigationContainer } from '@react-navigation/native';
import dayjs from 'dayjs';
import advancedFormat from 'dayjs/plugin/advancedFormat';
import localizedFormat from 'dayjs/plugin/localizedFormat';
import relativeTime from 'dayjs/plugin/relativeTime';
import { DefaultTheme, Provider as PaperProvider } from 'react-native-paper';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
import { ApiContextProvider } from './src/component/ApiContext';
import { EnvironmentContextProvider } from './src/component/EnvironmentContext';
import { OrganizationContextProvider } from './src/component/OrganizationContext';
import { SettingsContextProvider } from './src/component/SettingsContext';
import Bootloader from './src/view/Bootloader';
// dayjs plugin setup
dayjs.extend(localizedFormat);
dayjs.extend(relativeTime);
dayjs.extend(advancedFormat);
// TODO(mikey): Use our very own special colors here.
const theme = {
...DefaultTheme,
colors: {
...DefaultTheme.colors,
primary: '#673AB7',
accent: '#607D8B',
text: '#212121',
background: '#D1C4E9',
// $primary-color-text: #FFFFFF
// $secondary-text-color: #757575
// $divider-color: #BDBDBD
},
};
export default function App() {
return (
<PaperProvider
theme={theme}
settings={{
icon: (props) => <FontAwesome5 {...props} />,
}}
>
<EnvironmentContextProvider>
<SettingsContextProvider>
<ApiContextProvider>
<OrganizationContextProvider>
<SafeAreaProvider>
<NavigationContainer>
<Bootloader />
</NavigationContainer>
</SafeAreaProvider>
</OrganizationContextProvider>
</ApiContextProvider>
</SettingsContextProvider>
</EnvironmentContextProvider>
</PaperProvider>
);
}