diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift index eee85105..036c636f 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankAccountListItem.swift @@ -19,11 +19,25 @@ struct BankAccountListItem : View { AmountLabel(amount: account.balance) }.frame(height: 35) } + .contextMenu { + Button(action: { self.navigateToBankAccountSettingsDialog() }) { + HStack { + Text("Settings") + + Image(systemName: "gear") + } + } + } .onTapGesture { self.navigateToAccountTransactionsDialog = true } } + + private func navigateToBankAccountSettingsDialog() { + SceneDelegate.navigateToView(BankAccountSettingsDialog(account)) + } + } diff --git a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift index 7d540910..e81812de 100644 --- a/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift +++ b/ui/BankingiOSApp/BankingiOSApp/ui/views/BankListItem.swift @@ -24,6 +24,14 @@ struct BankListItem : View { } .frame(height: 35) .contextMenu { + Button(action: { self.navigateToBankSettingsDialog() }) { + HStack { + Text("Settings") + + Image(systemName: "gear") + } + } + Button(action: askUserToDeleteAccount) { HStack { Text("Delete account") @@ -45,8 +53,12 @@ struct BankListItem : View { } } + + private func navigateToBankSettingsDialog() { + SceneDelegate.navigateToView(BankSettingsDialog(bank)) + } - func askUserToDeleteAccount() { + private func askUserToDeleteAccount() { // couldn't believe it, .alert() didn't work as SwiftUI resetted @State variable to dislpay it instantly, therefore Alert never got displayed // TODO: use values from Message.createAskUserToDeleteAccountMessage(self.bank, self.deleteAccount) UIAlert( @@ -57,7 +69,7 @@ struct BankListItem : View { ).show() } - func deleteAccount(_ bank: Customer) { + private func deleteAccount(_ bank: Customer) { presenter.deleteAccount(customer: bank) }