-
Notifications
You must be signed in to change notification settings - Fork 12
/
AppStarter.tsx
38 lines (34 loc) · 1.05 KB
/
AppStarter.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
import React from 'react';
import { View, Platform } from 'react-native';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { MDXProvider } from '@mdx-js/react';
import { AppearanceProvider } from 'react-native-appearance';
import AppMDXComponents from './AppMDXComponents';
import AppNavigator from './AppNavigator';
import { AppColorSchemeProvider } from './AppColorSchemeContext';
const AppStarter = () => {
return (
<AppearanceProvider>
<AppColorSchemeProvider>
<SafeAreaProvider>
<MDXProvider components={AppMDXComponents}>
<AppNavigator />
</MDXProvider>
</SafeAreaProvider>
</AppColorSchemeProvider>
</AppearanceProvider>
);
};
// TODO hack to fix web issue, does not work yet
const provideThemeUIForWeb = (Comp) => {
if (Platform.OS === 'web') {
const ThemeProvider = require('theme-ui').ThemeProvider;
return () => (
<ThemeProvider>
<Comp />
</ThemeProvider>
);
}
return Comp;
};
export default provideThemeUIForWeb(AppStarter);