Added vibrant selection to Account navigation links
This commit is contained in:
parent
8063488bc8
commit
e3270f5ef4
|
@ -39,16 +39,24 @@ struct SettingsView : View {
|
|||
}
|
||||
}
|
||||
|
||||
@State private var accountAction: Int? = nil
|
||||
|
||||
func buildAccountsSection() -> some View {
|
||||
Section(header: Text("ACCOUNTS").padding(.top, 22.0)) {
|
||||
ForEach(viewModel.accounts) { account in
|
||||
NavigationLink(destination: SettingsDetailAccountView(viewModel: SettingsDetailAccountView.ViewModel(account))) {
|
||||
Text(verbatim: account.nameForDisplay)
|
||||
ForEach(0..<viewModel.accounts.count) { index in
|
||||
NavigationLink(destination: SettingsDetailAccountView(viewModel: SettingsDetailAccountView.ViewModel(self.viewModel.accounts[index])), tag: index, selection: self.$accountAction) {
|
||||
Text(verbatim: self.viewModel.accounts[index].nameForDisplay)
|
||||
}
|
||||
.modifier(VibrantSelectAction(action: {
|
||||
self.accountAction = index
|
||||
}))
|
||||
}
|
||||
NavigationLink(destination: SettingsAddAccountView()) {
|
||||
NavigationLink(destination: SettingsAddAccountView(), tag: 1000, selection: $accountAction) {
|
||||
Text("Add Account")
|
||||
}
|
||||
.modifier(VibrantSelectAction(action: {
|
||||
self.accountAction = 1000
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue