diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/SideMenu.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/SideMenu.kt index 3d64008..4765392 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/SideMenu.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/appskeleton/SideMenu.kt @@ -53,6 +53,8 @@ private val iconSize = 24.dp fun SideMenu(appContent: @Composable () -> Unit) { val drawerState = uiState.drawerState.collectAsState().value + val accounts = uiState.userAccounts.collectAsState().value + val coroutineScope = rememberCoroutineScope() ModalDrawer( @@ -97,18 +99,32 @@ fun SideMenu(appContent: @Composable () -> Unit) { drawerState.close() } } + + if (accounts.isNotEmpty()) { + Spacer(Modifier.height(12.dp)) + + NavigationMenuItem(itemModifier, "Neue Überweisung", textColor, horizontalPadding = ItemHorizontalPadding, icon = { Icon(Icons.Filled.Add, "Konto hinzufügen", Modifier.size(iconSize)) }) { + uiState.showTransferMoneyDialog.value = true + + coroutineScope.launch { + drawerState.close() + } + } + } } - Divider(color = Colors.DrawerDivider) + if (accounts.isNotEmpty()) { + Divider(color = Colors.DrawerDivider) - Spacer(Modifier.height(12.dp)) + Spacer(Modifier.height(12.dp)) - NavigationMenuItem(itemModifier, "Daten exportieren", textColor, horizontalPadding = ItemHorizontalPadding, icon = { Icon(Icons.AutoMirrored.Filled.Send, "Konto hinzufügen", Modifier.size(iconSize)) }) { - coroutineScope.launch { - drawerState.close() + NavigationMenuItem(itemModifier, "Daten exportieren", textColor, horizontalPadding = ItemHorizontalPadding, icon = { Icon(Icons.AutoMirrored.Filled.Send, "Konto hinzufügen", Modifier.size(iconSize)) }) { + coroutineScope.launch { + drawerState.close() + } + + uiState.showExportScreen.value = true } - - uiState.showExportScreen.value = true } } }