Update Add Account to use correct form of sheet showing
This commit is contained in:
parent
1caaf3c154
commit
5bfeb77706
|
@ -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
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue