Update Add Account to use correct form of sheet showing

This commit is contained in:
Maurice Parker 2019-09-08 06:43:29 -05:00
parent 1caaf3c154
commit 5bfeb77706
2 changed files with 9 additions and 6 deletions

View File

@ -9,6 +9,12 @@
import Foundation
import Account
extension AccountType: Identifiable {
public var id: Int {
return rawValue
}
}
extension Account: Identifiable {
public var id: String {
return accountID

View File

@ -11,7 +11,6 @@ import Account
struct SettingsAddAccountView : View {
@State private var isAddPresented = false
@State private var selectedAccountType: AccountType = nil
var body: some View {
@ -19,25 +18,23 @@ struct SettingsAddAccountView : View {
Button(action: {
self.selectedAccountType = AccountType.onMyMac
self.isAddPresented.toggle()
}) {
SettingsAccountLabelView(accountImage: "accountLocal", accountLabel: Account.defaultLocalAccountName)
}
Button(action: {
self.selectedAccountType = AccountType.feedbin
self.isAddPresented.toggle()
}) {
SettingsAccountLabelView(accountImage: "accountFeedbin", accountLabel: "Feedbin")
}
}
.sheet(isPresented: $isAddPresented) {
if self.selectedAccountType == .onMyMac {
.sheet(item: $selectedAccountType) { accountType in
if accountType == .onMyMac {
SettingsLocalAccountView(name: "")
}
if self.selectedAccountType == .feedbin {
if accountType == .feedbin {
SettingsFeedbinAccountView(viewModel: SettingsFeedbinAccountView.ViewModel())
}
}