Added footer to add account

This commit is contained in:
dankito 2020-09-05 02:39:36 +02:00
parent 5d29a12f02
commit f447b17aa6
1 changed files with 14 additions and 1 deletions

View File

@ -14,7 +14,8 @@ struct SettingsDialog: View {
var body: some View {
Form {
Section(header: SectionHeaderWithRightAlignedEditButton("Bank Credentials", isEditButtonEnabled: data.hasAtLeastOneAccountBeenAdded)) {
Section(header: SectionHeaderWithRightAlignedEditButton("Bank Credentials", isEditButtonEnabled: data.hasAtLeastOneAccountBeenAdded),
footer: footer) {
ForEach(data.banksSorted) { bank in
NavigationLink(destination: LazyView(BankSettingsDialog(bank))) {
IconedTitleView(bank)
@ -30,6 +31,18 @@ struct SettingsDialog: View {
.showNavigationBarTitle("Settings")
}
private var footer: some View {
get {
HStack {
Spacer()
NavigationLink(destination: LazyView(AddAccountDialog())) {
Text("Add")
}
}
}
}
func reorderBanks(from sourceIndices: IndexSet, to destinationIndex: Int) {
let _ = data.banksSorted.reorder(from: sourceIndices, to: destinationIndex)