NetNewsWire/Multiplatform/iOS/Settings/Accounts/SettingsAddAccountView.swift

56 lines
1.2 KiB
Swift
Raw Normal View History

//
// SettingsAddAccountView.swift
// Multiplatform iOS
//
// Created by Rizwan on 07/07/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
import Account
struct SettingsAddAccountView: View {
@StateObject private var model = SettingsAddAccountModel()
var body: some View {
List {
ForEach(model.accounts) { account in
Button(action: {
model.selectedAccountType = account.accountType
}) {
SettingsAccountLabelView(
accountImage: account.image,
accountLabel: account.name
)
}
}
}
.listStyle(InsetGroupedListStyle())
.sheet(isPresented: $model.isAddPresented) {
2020-12-05 15:58:11 +01:00
switch model.selectedAccountType! {
case .onMyMac:
2020-12-05 15:18:10 +01:00
AddLocalAccountView()
2020-12-05 15:58:11 +01:00
case .feedbin:
AddFeedbinAccountView()
case .cloudKit:
2020-12-05 15:58:11 +01:00
AddCloudKitAccountView()
case .feedWrangler:
AddFeedWranglerAccountView()
case .newsBlur:
AddNewsBlurAccountView()
case .feedly:
AddFeedlyAccountView()
default:
2020-12-05 15:58:11 +01:00
AddReaderAPIAccountView(accountType: model.selectedAccountType!)
}
}
.navigationBarTitle(Text("Add Account"), displayMode: .inline)
}
}
struct SettingsAddAccountView_Previews: PreviewProvider {
static var previews: some View {
SettingsAddAccountView()
}
}