-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.js
More file actions
66 lines (57 loc) · 1.83 KB
/
App.js
File metadata and controls
66 lines (57 loc) · 1.83 KB
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
import React, { useEffect } from 'react';
import { registerRootComponent } from 'expo';
import { NavigationContainer } from '@react-navigation/native';
import { Provider, useDispatch } from 'react-redux';
import { StatusBar, StyleSheet, SafeAreaView } from 'react-native';
import 'react-native-gesture-handler';
import StackNavigator from './src/navigation';
import { store } from './src/redux/store';
import ErrorBoundary from './src/utilities/errorBoundary';
import { enableScreens } from 'react-native-screens';
import LeftMenu from './src/components/header/leftMenu';
import JobAndHold from './src/components/jobAndHold';
import { changeLangs } from './src/redux/slices/langSlice';
import './i18n';
import { PaperProvider } from 'react-native-paper';
import * as ScreenCapture from 'expo-screen-capture';
enableScreens();
const LanguageInitializer = () => {
const dispatch = useDispatch();
useEffect(() => {
dispatch(changeLangs(""));
}, [dispatch]);
return null;
};
const App = () => {
useEffect(() => {
ScreenCapture.preventScreenCaptureAsync();
}, []);
return (
<ErrorBoundary>
<Provider store={store}>
<PaperProvider>
<SafeAreaView style={styles.container}>
<StatusBar backgroundColor="#00385b" barStyle="dark-content" />
<NavigationContainer>
<StatusBar hidden={false} backgroundColor="#145575" barStyle="light-content" />
<LanguageInitializer />
<StackNavigator />
<LeftMenu />
<JobAndHold />
</NavigationContainer>
</SafeAreaView>
</PaperProvider>
</Provider>
</ErrorBoundary>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
width: '100%',
height: '100%',
backgroundColor: '#f5f5f5'
},
});
registerRootComponent(App);
export default App;