-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathApp.tsx
64 lines (60 loc) · 2.1 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
/**
* Sample React Native App
* https://github.com/facebook/react-native
*
* Generated with the TypeScript template
* https://github.com/react-native-community/react-native-template-typescript
*
* @format
*/
import 'react-native-gesture-handler';
import React from 'react';
import { SafeAreaProvider } from 'react-native-safe-area-context';
import { RecoilRoot } from 'recoil';
import { MenuProvider } from 'react-native-popup-menu';
import Toast from 'react-native-toast-message';
import AppContainer from './screens/Container';
import themes from './theme/index';
import ErrorBoundary from './screens/ErrorBoundary';
import { ThemeContext } from './ThemeContext';
import GlobalStatusBar from './GlobalStatusBar';
import { Platform, View } from 'react-native';
import CustomText from './components/Text';
declare const global: { HermesInternal: null | {} };
const DEFAULT_THEME = themes.dark;
export { ThemeContext };
const App = () => {
return (
<RecoilRoot>
<ThemeContext.Provider value={DEFAULT_THEME}>
<GlobalStatusBar />
<SafeAreaProvider>
<ErrorBoundary>
<MenuProvider>
<AppContainer />
</MenuProvider>
</ErrorBoundary>
</SafeAreaProvider>
<Toast ref={(ref) => Toast.setRef(ref)}
config={
{
success: ({ text1 = '', props = {}, ...rest }) => (
<View style={{ height: 32, minWidth: 77, paddingHorizontal: 16, paddingVertical: 8, backgroundColor: (props as any).backgroundColor || '#DDFFDB', borderRadius: 8, alignItems: 'center', justifyContent: 'center' }}>
<CustomText
style={{
color: (props as any).textColor || 'rgba(69, 188, 67, 1)',
fontWeight: '500',
fontFamily: Platform.OS === 'android' ? 'WorkSans-SemiBold' : undefined
}}
>
{text1}
</CustomText>
</View>
)
}
} />
</ThemeContext.Provider>
</RecoilRoot>
);
};
export default App;