import React from 'react'; // Sentry import * as Sentry from "@sentry/react-native"; // Redux import { Provider } from 'react-redux'; import { store } from './App/Store/ConfigureStore'; import { initDocuments } from './App/Store/Actions/documents'; // Deps import 'react-native-gesture-handler'; import { NavigationContainer } from '@react-navigation/native'; import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { navigationRef, navigate } from './Navigation'; import { TouchableOpacity, View, Image, Text, TextInput, Alert, DrawerLayoutAndroid, Button } from 'react-native'; import Icon from 'react-native-vector-icons/FontAwesome5'; import FlashMessage, { showMessage } from 'react-native-flash-message'; import * as SplashScreen from 'expo-splash-screen'; // Application infos import * as Application from 'expo-application'; // i18n import i18n from "./I18n"; // FileSytem import * as FileSystem from 'expo-file-system'; // Views import InstallScreen from './App/Views/InstallScreen'; import LoginScreen from './App/Views/LoginScreen'; import SyncScreen from './App/Views/SyncScreen'; import HomeScreen from './App/Views/HomeScreen'; import DirectoriesScreen from './App/Views/DirectoriesScreen'; import PDFScreen from './App/Views/PDFScreen'; import VideoScreen from './App/Views/VideoScreen'; import OnlyVideosScreen from './App/Views/OnlyVideosScreen'; import ContactScreen from './App/Views/ContactScreen'; import ContactDetailsScreen from './App/Views/ContactDetailsScreen'; import SearchScreen from "./App/Views/SearchScreen"; import MySpaceScreen from './App/Views/MySpaceScreen'; // Style import styles from './Resources/Styles/NavigationStyle'; // Controllers import SyncController from './App/Controllers/SyncController'; Sentry.init({ dsn: "https://ab87e8d840324f41873c95b06903b0bf@o4504314935640064.ingest.sentry.io/4504441255886848", }); Sentry.setContext("app", { boUrl: SyncController.getUrlBo() }); SplashScreen.preventAutoHideAsync(); //Keep store.dispatch({ type: 'INIT' }); store.dispatch({ type: 'INIT_LOCALE' }); store.dispatch({ type: 'INIT_USERS' }); const Stack = createNativeStackNavigator(); class App extends React.Component { state = { isSetup: false, isLogged: false, searchTxt: '', sendEmail: '', mainColor: '', drawerRef: React.createRef() }; componentDidMount() { const unsubscribe = store.subscribe(this.handleChange.bind(this)); this.setState({ isSetup: store.getState().app.isSetup, isLogged: store.getState().app.logged, mainColor: store.getState().app.mainColor }); } handleChange() { this.setState({ isSetup: store.getState().app.isSetup, isLogged: store.getState().app.logged, mainColor: store.getState().app.mainColor }); // to force re-rendering console.log("state changed") } navigationView = () => ( { this.state.drawerRef.current.closeDrawer(); store.dispatch({ type: 'EDIT_LOCALE' }); store.dispatch(initDocuments(store.getState().locale.locale, store.getState().directories.global)) }} style={styles.drawer.btn}> {i18n.t('global.change_lang')} { this.state.drawerRef.current.closeDrawer(); navigate('SyncScreen') }} style={styles.drawer.btn}> {i18n.t('global.sync')} { this.state.drawerRef.current.closeDrawer(); store.dispatch({ type: 'SET_CURRENT_USER', data: false }); }} style={styles.drawer.btn}> {i18n.t('global.logout')} Version : {Application.nativeApplicationVersion}