Implemented showing balance in AllBanksListItem, BankAccountListItem and BankListItem; extracted AmountLabel for that
This commit is contained in:
parent
4340b80925
commit
ca214457ca
|
@ -38,13 +38,13 @@ struct ContentView: View {
|
|||
TanMedium(displayName: "Handy mit Nummer 0170 / 12345678", status: .available)
|
||||
]
|
||||
|
||||
self.enterTanState = EnterTanState(customer, TanChallenge(messageToShowToUser: "Gib die TAN ein du faules Stueck!", tanProcedure: selectedTanProcedure)) { result in }
|
||||
self.enterTanState = EnterTanState(customer, TanChallenge(messageToShowToUser: "Gib die TAN ein du faules Stueck!\nAber jetzt manchen wir mal eine richtig, richtig lange Nachricht daraus.\nMal schauen, ob mir so viel Quatsch ueberhaupt einfaellt (aber anscheinend scheine ich sehr kreativ zu sein).", tanProcedure: selectedTanProcedure)) { result in }
|
||||
}
|
||||
|
||||
|
||||
var body: some View {
|
||||
// NavigationView {
|
||||
VStack {
|
||||
// VStack {
|
||||
TabView(selection: $selection) {
|
||||
AccountsTab(data: data)
|
||||
.onAppear {
|
||||
|
@ -121,13 +121,15 @@ struct ContentView: View {
|
|||
}
|
||||
.tag(1)
|
||||
|
||||
NavigationView { EnterTanDialog(self.enterTanState) }
|
||||
EnterTanDialog(self.enterTanState)
|
||||
.tabItem {
|
||||
VStack {
|
||||
Text("EnterTanDialog")
|
||||
}
|
||||
}
|
||||
.tag(2)
|
||||
.tag(3)
|
||||
.navigationBarHidden(false)
|
||||
.navigationBarTitle("Enter TAN")
|
||||
|
||||
}
|
||||
.navigationBarHidden(false)
|
||||
|
@ -135,8 +137,9 @@ struct ContentView: View {
|
|||
.navigationBarItems(leading: leadingNavigationBarItem)
|
||||
|
||||
|
||||
}
|
||||
.hideNavigationBar()
|
||||
// }
|
||||
//.hideNavigationBar()
|
||||
//.navigationViewStyle(StackNavigationViewStyle()) // see https://stackoverflow.com/questions/59338711/swiftui-bug-navigationview-and-list-not-showing-on-ipad-simulator-only
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
import SwiftUI
|
||||
import BankingUiSwift
|
||||
|
||||
|
||||
struct AmountLabel: View {
|
||||
|
||||
let amount: CommonBigDecimal
|
||||
|
||||
@Inject private var presenter: BankingPresenterSwift
|
||||
|
||||
|
||||
var body: some View {
|
||||
Text(presenter.formatAmount(amount: amount))
|
||||
.styleAmount(amount: amount)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
struct AmountLabel_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AmountLabel(amount: CommonBigDecimal(double: 84.12))
|
||||
}
|
||||
}
|
|
@ -40,8 +40,7 @@ struct AccountTransactionListItem: View {
|
|||
Spacer()
|
||||
|
||||
VStack(alignment: .trailing) {
|
||||
Text(presenter.formatAmount(amount: transaction.amount))
|
||||
.styleAmount(amount: transaction.amount)
|
||||
AmountLabel(amount: transaction.amount)
|
||||
|
||||
Spacer()
|
||||
|
||||
|
|
|
@ -69,8 +69,7 @@ struct AccountTransactionsDialog: View {
|
|||
|
||||
Spacer()
|
||||
|
||||
Text(presenter.formatAmount(amount: balanceOfFilteredTransactions))
|
||||
.styleAmount(amount: balanceOfFilteredTransactions)
|
||||
AmountLabel(amount: balanceOfFilteredTransactions)
|
||||
}
|
||||
.padding(.horizontal)
|
||||
|
||||
|
|
|
@ -15,6 +15,8 @@ struct AllBanksListItem: View {
|
|||
.font(.headline)
|
||||
|
||||
Spacer()
|
||||
|
||||
AmountLabel(amount: banks.sumBalances())
|
||||
}.frame(height: 35)
|
||||
|
||||
NavigationLink(destination: LazyView(AccountTransactionsDialog(allBanks: self.banks))) {
|
||||
|
|
|
@ -11,7 +11,10 @@ struct BankAccountListItem : View {
|
|||
ZStack {
|
||||
HStack {
|
||||
Text(account.displayName)
|
||||
|
||||
Spacer()
|
||||
|
||||
AmountLabel(amount: account.balance)
|
||||
}.frame(height: 35)
|
||||
|
||||
NavigationLink(destination: LazyView(AccountTransactionsDialog(account: self.account))) {
|
||||
|
|
|
@ -15,6 +15,8 @@ struct BankListItem : View {
|
|||
.font(.headline)
|
||||
|
||||
Spacer()
|
||||
|
||||
AmountLabel(amount: bank.balance)
|
||||
}.frame(height: 35)
|
||||
|
||||
NavigationLink(destination: LazyView(AccountTransactionsDialog(bank: self.bank))) {
|
||||
|
|
Loading…
Reference in New Issue