mirror of
https://github.com/mudabbir-ahmad/Project-MAD-crudler.git
synced 2026-10-07 20:40:20 +00:00
made it so there is no hamburger menu instead the user swips to open the drawer, issue for those android devices with no soft/hard buttons, gesture controls take over and utilise the android back feature rather than the app's swipe to open drawer, however works fine on other devices that use soft coded / hard buttons.
This commit is contained in:
1 parent
09f92febf9
commit
30474c19bb
1 file changed
+12
-4
@@ -9,6 +9,7 @@ import UserViewScreen from "./src/components/screens/UserViewScreen";
|
|||||||
import UserAddScreen from "./src/components/screens/UserAddScreen";
|
import UserAddScreen from "./src/components/screens/UserAddScreen";
|
||||||
import UserListScreen from "./src/components/screens/UserListScreen";
|
import UserListScreen from "./src/components/screens/UserListScreen";
|
||||||
import {createDrawerNavigator} from '@react-navigation/drawer';
|
import {createDrawerNavigator} from '@react-navigation/drawer';
|
||||||
|
import {StyleSheet} from "react-native";
|
||||||
|
|
||||||
const Drawer = createDrawerNavigator();
|
const Drawer = createDrawerNavigator();
|
||||||
const Stack = createNativeStackNavigator();
|
const Stack = createNativeStackNavigator();
|
||||||
@@ -17,12 +18,14 @@ const ModuleStack = () => (
|
|||||||
<Stack.Navigator
|
<Stack.Navigator
|
||||||
initialRouteName='ModuleListScreen'
|
initialRouteName='ModuleListScreen'
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
headerShown: false // Hide stack headers
|
headerStyle: {backgroundColor: "black"},
|
||||||
|
headerTintColor: "white"
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="ModuleListScreen"
|
name="ModuleListScreen"
|
||||||
component={ModuleListScreen}
|
component={ModuleListScreen}
|
||||||
|
options={{headerShown: true}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="ModuleAddScreen"
|
name="ModuleAddScreen"
|
||||||
@@ -42,12 +45,16 @@ const ModuleStack = () => (
|
|||||||
const UserStack = () => (
|
const UserStack = () => (
|
||||||
<Stack.Navigator
|
<Stack.Navigator
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
headerShown: false // Hide stack headers
|
headerStyle: {backgroundColor: "black"},
|
||||||
|
headerTintColor: "white",
|
||||||
|
swipeEdgeWidth: 100,
|
||||||
|
drawerType: 'slide',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="UserListScreen"
|
name="UserListScreen"
|
||||||
component={UserListScreen}
|
component={UserListScreen}
|
||||||
|
options={{headerShown: true}}
|
||||||
/>
|
/>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="UserAddScreen"
|
name="UserAddScreen"
|
||||||
@@ -69,8 +76,9 @@ export const App = () => {
|
|||||||
<NavigationContainer>
|
<NavigationContainer>
|
||||||
<Drawer.Navigator
|
<Drawer.Navigator
|
||||||
screenOptions={{
|
screenOptions={{
|
||||||
headerStyle: {backgroundColor: "black"},
|
headerBackgroundColor: "black",
|
||||||
headerTintColor: "white"
|
headerShown: false,
|
||||||
|
swipeEnabled: true
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Drawer.Screen
|
<Drawer.Screen
|
||||||
|
|||||||
Reference in new issue
Block a user