Skip to content

Commit

Permalink
chore: moved modal provider to be inside drawer
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSin committed May 5, 2024
1 parent b755c62 commit 9b1a998
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
5 changes: 1 addition & 4 deletions src/frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {PermissionsAndroid} from 'react-native';
import {AppProviders} from './contexts/AppProviders';
import {createLocalDiscoveryController} from './contexts/LocalDiscoveryContext';
import {Loading} from './sharedComponents/Loading';
import {BottomSheetModalProvider} from '@gorhom/bottom-sheet';
import 'react-native-gesture-handler';

const messagePort = new MessagePortLike();
Expand Down Expand Up @@ -41,9 +40,7 @@ const App = () => {
mapeoApi={mapeoApi}>
<React.Suspense fallback={<Loading />}>
<NavigationContainer ref={navRef}>
<BottomSheetModalProvider>
<AppNavigator permissionAsked={permissionsAsked} />
</BottomSheetModalProvider>
<AppNavigator permissionAsked={permissionsAsked} />
</NavigationContainer>
</React.Suspense>
</AppProviders>
Expand Down
1 change: 0 additions & 1 deletion src/frontend/AppNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const AppNavigator = ({permissionAsked}: {permissionAsked: boolean}) => {
return (
<React.Fragment>
<DrawerNavigator permissionAsked={permissionAsked} />
<ProjectInviteBottomSheet />
</React.Fragment>
);
};
12 changes: 9 additions & 3 deletions src/frontend/Navigation/Stack/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import {usePresetsQuery} from '../../hooks/server/presets';
import {getInitialRouteName} from '../../utils/navigation';
import {WHITE} from '../../lib/styles';
import {CustomHeaderLeft} from '../../sharedComponents/CustomHeaderLeft';
import {BottomSheetModalProvider} from '@gorhom/bottom-sheet';
import {ProjectInviteBottomSheet} from '../../sharedComponents/ProjectInviteBottomSheet';

export type AppStackList = AppList & DeviceNamingSceens;

Expand All @@ -28,9 +30,13 @@ export const RootStackNavigator = ({
navigation,
}: DrawerScreenProps<DrawerScreens, 'DrawerHome'>) => {
return (
<Suspense fallback={<Loading />}>
<RootStackNavigatorChild openDrawer={navigation.openDrawer} />
</Suspense>
// This provider must be inside the drawer. Otherwise it is always rendered on top of the drawer
<BottomSheetModalProvider>
<Suspense fallback={<Loading />}>
<RootStackNavigatorChild openDrawer={navigation.openDrawer} />
<ProjectInviteBottomSheet />
</Suspense>
</BottomSheetModalProvider>
);
};

Expand Down

0 comments on commit 9b1a998

Please sign in to comment.