Files
NetNewsWire/Mac/Preferences/Accounts/AddAccountHelpView.swift
T

46 lines
1.0 KiB
Swift
Raw Normal View History

2020-11-04 10:35:53 +08:00
//
// AddAccountHelpView.swift
// NetNewsWire
//
// Created by Stuart Breckenridge on 4/11/20.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
import Account
struct AddAccountHelpView: View {
2025-11-05 11:22:10 -08:00
2020-11-04 10:35:53 +08:00
let accountTypes: [AccountType] = AddAccountSections.allOrdered.sectionContent
var delegate: AccountsPreferencesAddAccountDelegate?
var helpText: String
var hasiCloudAccount: Bool {
2026-03-21 13:35:56 -07:00
AccountManager.shared.hasiCloudAccount
}
2020-11-04 10:35:53 +08:00
var body: some View {
VStack {
HStack {
ForEach(accountTypes, id: \.self) { accountType in
if accountType == .cloudKit && hasiCloudAccount {
EmptyView()
} else if !(AppDefaults.isDeveloperBuild && accountType.isDeveloperRestricted) {
Button(action: {
delegate?.presentSheetForAccount(accountType)
}, label: {
accountType.image()
.resizable()
.frame(width: 20, height: 20, alignment: .center)
})
.buttonStyle(PlainButtonStyle())
}
2020-11-04 10:35:53 +08:00
}
}
2025-11-05 11:22:10 -08:00
2020-11-04 10:35:53 +08:00
Text(helpText)
.multilineTextAlignment(.center)
.padding(.top, 8)
}
}
}