aboutsummaryrefslogtreecommitdiff
path: root/App.tsx
blob: 08886a08f6e4e70877a234e5be0adaa2be22fe7b (plain) (blame)
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
import React, {Suspense, useEffect} from 'react';
import {BackHandler, SafeAreaView, View} from 'react-native';
import {GestureHandlerRootView} from 'react-native-gesture-handler';
import {AppView} from './src/AppView';
import {Provider as JotaiProvider} from 'jotai';

const App: React.FC = () => {
  // Disable back button
  useEffect(() => {
    const sub = BackHandler.addEventListener('hardwareBackPress', () => true);
    return () => sub.remove();
  }, []);

  return (
    <Suspense fallback={<View className="flex flex-1 bg-black" />}>
      <JotaiProvider>
        <GestureHandlerRootView>
          <SafeAreaView className="flex flex-1 bg-black text-slate-200">
            <AppView />
          </SafeAreaView>
        </GestureHandlerRootView>
      </JotaiProvider>
    </Suspense>
  );
};

export default App;