feat(mobile): mount CallProvider + global IncomingCallModal
This commit is contained in:
+11
-10
@@ -5,13 +5,11 @@ import { GestureHandlerRootView } from 'react-native-gesture-handler';
|
||||
import { SafeAreaProvider } from 'react-native-safe-area-context';
|
||||
|
||||
import { ErrorBoundary } from '../components/ErrorBoundary';
|
||||
import { IncomingCallModal } from '../components/IncomingCallModal';
|
||||
import { AuthProvider } from '../lib/authContext';
|
||||
import { CallProvider } from '../lib/callContext';
|
||||
import { createLibsodiumBackend } from '../lib/cryptoBackend';
|
||||
|
||||
// Register the crypto backend exactly once, before any code that calls
|
||||
// crypto.getCryptoBackend(). Doing it at module load (not inside the
|
||||
// component) avoids a race where a child component renders before the
|
||||
// effect fires.
|
||||
crypto.setCryptoBackend(createLibsodiumBackend());
|
||||
|
||||
export default function RootLayout() {
|
||||
@@ -20,12 +18,15 @@ export default function RootLayout() {
|
||||
<SafeAreaProvider>
|
||||
<ErrorBoundary>
|
||||
<AuthProvider>
|
||||
<StatusBar style="auto" />
|
||||
<Stack screenOptions={{ headerShown: false }}>
|
||||
<Stack.Screen name="index" />
|
||||
<Stack.Screen name="(app)" />
|
||||
<Stack.Screen name="auth/callback" />
|
||||
</Stack>
|
||||
<CallProvider>
|
||||
<StatusBar style="auto" />
|
||||
<Stack screenOptions={{ headerShown: false }}>
|
||||
<Stack.Screen name="index" />
|
||||
<Stack.Screen name="(app)" />
|
||||
<Stack.Screen name="auth/callback" />
|
||||
</Stack>
|
||||
<IncomingCallModal />
|
||||
</CallProvider>
|
||||
</AuthProvider>
|
||||
</ErrorBoundary>
|
||||
</SafeAreaProvider>
|
||||
|
||||
Reference in New Issue
Block a user