import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { View } from 'react-native';
import BottomTabs from './BottomTabs';
import SettingsProvider from './SettingsProvider';
import Interface from './Interface';
import ErrorBoundary from 'react-native-error-boundary';
import { ToastProvider } from './common/ToastProvider';
import { Toast } from './common/Toast';
import { SafeAreaProvider } from 'react-native-safe-area-context';

const App = () => {
  // https://medium.com/@jimmyalbert/handle-errors-in-react-native-897713baf166
  return (
    <SafeAreaProvider>
      <View style={{ flex: 1, backgroundColor: '#3D3D3D' }}>
        <ErrorBoundary>
          <ToastProvider>
            <SettingsProvider>
              <Interface>
                <NavigationContainer>
                  <BottomTabs />
                </NavigationContainer>
              </Interface>
            </SettingsProvider>
            <Toast />
          </ToastProvider>
        </ErrorBoundary>
      </View>
    </SafeAreaProvider>
  );
};

export default App;

// npm install -g eas-cli
// eas login
// eas build:configure
// eas build -p android --profile preview
// eas build --platform android
// eas build --platform all

// https://reactnavigation.org/docs/getting-started/ fehler bei 1. mal installieren
// https://medium.com/@ganiilhamirsyadi/dockerize-react-native-expo-app-152c1e65e76c Evtl app als website in docker hosten