From 564f96ae47ba34d43f9b4186d2380448da26c4e2 Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Mon, 13 Jul 2020 10:57:42 +0800 Subject: [PATCH] Add Account Picker now displays accounts --- .../AccountsPreferencesView.swift | 144 +++++++++++++----- 1 file changed, 103 insertions(+), 41 deletions(-) diff --git a/Multiplatform/macOS/Preferences/Preference Panes/AccountsPreferencesView.swift b/Multiplatform/macOS/Preferences/Preference Panes/AccountsPreferencesView.swift index f7d853583..60ff250ae 100644 --- a/Multiplatform/macOS/Preferences/Preference Panes/AccountsPreferencesView.swift +++ b/Multiplatform/macOS/Preferences/Preference Panes/AccountsPreferencesView.swift @@ -6,10 +6,17 @@ // import SwiftUI +import Account struct AccountPreferencesViewModel { - let accountTypes = ["On My Mac", "FeedBin"] - var selectedAccount = Int?.none + + // Sorted Accounts + let sortedAccounts = AccountManager.shared.sortedAccounts + + // Available Accounts + let accountTypes: [AccountType] = [.onMyMac, .feedbin, .feedly] + + var selectedAccount: Int? = 0 } struct AccountsPreferencesView: View { @@ -24,18 +31,21 @@ struct AccountsPreferencesView: View { VStack { HStack(alignment: .top, spacing: 10) { VStack(alignment: .leading) { - List(selection: $viewModel.selectedAccount, content: { - ForEach(0..