diff --git a/app/index.js b/app/index.js index e86460e0..bf2b55fd 100644 --- a/app/index.js +++ b/app/index.js @@ -129,18 +129,48 @@ const ChatsStack = createStackNavigator({ defaultNavigationOptions: defaultHeader }); +ChatsStack.navigationOptions = ({ navigation }) => { + let drawerLockMode = 'unlocked'; + if (navigation.state.index > 0) { + drawerLockMode = 'locked-closed'; + } + return { + drawerLockMode + }; +}; + const ProfileStack = createStackNavigator({ ProfileView }, { defaultNavigationOptions: defaultHeader }); +ProfileView.navigationOptions = ({ navigation }) => { + let drawerLockMode = 'unlocked'; + if (navigation.state.index > 0) { + drawerLockMode = 'locked-closed'; + } + return { + drawerLockMode + }; +}; + const SettingsStack = createStackNavigator({ SettingsView }, { defaultNavigationOptions: defaultHeader }); +SettingsStack.navigationOptions = ({ navigation }) => { + let drawerLockMode = 'unlocked'; + if (navigation.state.index > 0) { + drawerLockMode = 'locked-closed'; + } + return { + drawerLockMode + }; +}; + const ChatsDrawer = createDrawerNavigator({ ChatsStack, ProfileStack,