Skip to content
Snippets Groups Projects
App.tsx 1.6 KiB
Newer Older
  • Learn to ignore specific revisions
  • import React from 'react';
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    import { NavigationContainer } from '@react-navigation/native';
    import AntDesignProvider from '@ant-design/react-native/lib/provider';
    import Toast from 'react-native-toast-message';
    import { SafeAreaProvider } from 'react-native-safe-area-context';
    import { Platform } from 'react-native';
    import { ColorPallet, customTheme } from './src/theme/theme';
    import RootStack from './src/navigators/RootStack';
    import { initStoredLanguage } from './src/localization';
    import toastConfig from './src/components/toast/ToastConfig';
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    import {observer} from "mobx-react";
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    import {Buffer} from "buffer";
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    import {RealmProvider} from '@realm/react';
    import {schemas} from './src/db-models';
    import './src/seal/injectCryptoServiceMobile';
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    
    // Required by @vereign/lib-mime
    global.Buffer = Buffer;
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    
    const navigationTheme = {
      dark: false,
      colors: {
        primary: ColorPallet.brand.primary,
        background: ColorPallet.grayscale.white,
        card: ColorPallet.brand.primary,
        text: ColorPallet.grayscale.white,
        border: ColorPallet.grayscale.white,
        notification: ColorPallet.grayscale.white,
      },
    };
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    const App = observer(() => {
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      initStoredLanguage();
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    
      return (
    
    Alexey Lunin's avatar
    Alexey Lunin committed
        <SafeAreaProvider>
          <AntDesignProvider theme={customTheme}>
    
    Alexey Lunin's avatar
    Alexey Lunin committed
            <NavigationContainer theme={navigationTheme}>
              <RealmProvider schema={schemas}>
    
    Alexey Lunin's avatar
    Alexey Lunin committed
                <RootStack />
    
    Alexey Lunin's avatar
    Alexey Lunin committed
              </RealmProvider>
              <Toast
                topOffset={Platform.OS === 'android' ? 5 : 50}
                config={toastConfig}
              />
            </NavigationContainer>
    
    Alexey Lunin's avatar
    Alexey Lunin committed
          </AntDesignProvider>
        </SafeAreaProvider>
    
    Alexey Lunin's avatar
    Alexey Lunin committed
      );
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    });
    
    Alexey Lunin's avatar
    Alexey Lunin committed
    
    export default App;