Skip to content

Commit

Permalink
Hide modal drawer when opening the main app screen
Browse files Browse the repository at this point in the history
  • Loading branch information
etonotieno committed Oct 17, 2024
1 parent ee58c26 commit 7c64f58
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions android/src/main/kotlin/io/devbits/gocart/ui/GoCartApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,24 +71,22 @@ fun GoCartApp(
// Disable gestures on non DestinationRoutes
ModalNavigationDrawer(
drawerContent = {
if (appState.currentDestinationRoute != null) {
ModalDrawerSheet {
GoCartNavDrawerContent(
isLoggedIn = isLoggedIn,
onClickHeader = { },
onSignUp = {
appState.scope.launch { drawerState.close() }
appState.navController.popBackStack()
appState.navController.navigateToAuth()
},
items = NavDrawerItem.entries,
onClick = {
if (it == NavDrawerItem.LOGOUT) onLogout()
appState.scope.launch { drawerState.close() }
appState.navigateToRoute(it)
},
)
}
ModalDrawerSheet {
GoCartNavDrawerContent(
isLoggedIn = isLoggedIn,
onClickHeader = { },
onSignUp = {
appState.scope.launch { drawerState.close() }
appState.navController.popBackStack()
appState.navController.navigateToAuth()
},
items = NavDrawerItem.entries,
onClick = {
if (it == NavDrawerItem.LOGOUT) onLogout()
appState.scope.launch { drawerState.close() }
appState.navigateToRoute(it)
},
)
}
},
drawerState = drawerState,
Expand Down

0 comments on commit 7c64f58

Please sign in to comment.