mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-13 01:46:51 +01:00
50 lines
1.1 KiB
Swift
50 lines
1.1 KiB
Swift
//
|
|
// 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) {
|
|
switch model.selectedAccountType {
|
|
case .onMyMac:
|
|
SettingsLocalAccountView()
|
|
case .feedbin, .feedWrangler, .newsBlur, .freshRSS:
|
|
SettingsCredentialsAccountView(accountType: model.selectedAccountType!)
|
|
case .cloudKit:
|
|
SettingsCloudKitAccountView()
|
|
default:
|
|
EmptyView()
|
|
}
|
|
}
|
|
.navigationBarTitle(Text("Add Account"), displayMode: .inline)
|
|
}
|
|
}
|
|
|
|
struct SettingsAddAccountView_Previews: PreviewProvider {
|
|
static var previews: some View {
|
|
SettingsAddAccountView()
|
|
}
|
|
}
|