mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-12 17:36:19 +01:00
35 lines
1.0 KiB
Swift
35 lines
1.0 KiB
Swift
//
|
|
// SettingsSubscriptionsImportAccountPickerView.swift
|
|
// NetNewsWire-iOS
|
|
//
|
|
// Created by Maurice Parker on 10/20/19.
|
|
// Copyright © 2019 Ranchero Software. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
import Account
|
|
|
|
struct SettingsSubscriptionsImportAccountPickerView: View {
|
|
|
|
@Environment(\.presentationMode) var presentation
|
|
@State private var selectedAccount: Account?
|
|
@State private var isOPMLImportDocPickerPresented: Bool = false
|
|
|
|
var body: some View {
|
|
Form {
|
|
ForEach(AccountManager.shared.sortedActiveAccounts) { account in
|
|
Button(action: {
|
|
self.selectedAccount = account
|
|
self.isOPMLImportDocPickerPresented = true
|
|
}) {
|
|
Text(verbatim: account.nameForDisplay)
|
|
}.buttonStyle(VibrantButtonStyle(alignment: .leading))
|
|
}
|
|
}.sheet(isPresented: $isOPMLImportDocPickerPresented, onDismiss: { self.presentation.wrappedValue.dismiss() }) {
|
|
SettingsSubscriptionsImportDocumentPickerView(account: self.selectedAccount!)
|
|
}
|
|
.navigationBarTitle(Text("Select Account"), displayMode: .inline)
|
|
}
|
|
|
|
}
|