mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
add local account view
This commit is contained in:
@@ -13,7 +13,7 @@ import Combine
|
||||
class AccountsPreferencesModel: ObservableObject {
|
||||
|
||||
enum AccountConfigurationSheets {
|
||||
case add, credentials, none
|
||||
case addAccountPicker, credentials, none
|
||||
}
|
||||
|
||||
// Selected Account
|
||||
|
||||
@@ -29,7 +29,7 @@ struct AccountsPreferencesView: View {
|
||||
onDismiss: { viewModel.sheetToShow = .none },
|
||||
content: {
|
||||
switch viewModel.sheetToShow {
|
||||
case .add:
|
||||
case .addAccountPicker:
|
||||
AddAccountView()
|
||||
case .credentials:
|
||||
EditAccountCredentialsView(viewModel: viewModel)
|
||||
@@ -69,7 +69,7 @@ struct AccountsPreferencesView: View {
|
||||
Divider()
|
||||
HStack(alignment: .center, spacing: 4) {
|
||||
Button(action: {
|
||||
viewModel.sheetToShow = .add
|
||||
viewModel.sheetToShow = .addAccountPicker
|
||||
}, label: {
|
||||
Image(systemName: "plus")
|
||||
.font(.title)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
//
|
||||
// AddLocalAccount.swift
|
||||
// Multiplatform macOS
|
||||
//
|
||||
// Created by Stuart Breckenridge on 02/12/2020.
|
||||
// Copyright © 2020 Ranchero Software. All rights reserved.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
import Account
|
||||
import RSCore
|
||||
|
||||
struct AddLocalAccount: View {
|
||||
|
||||
@State private var newAccountName: String = ""
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
HStack(spacing: 16) {
|
||||
VStack(alignment: .leading) {
|
||||
AccountType.onMyMac.image()
|
||||
.resizable()
|
||||
.frame(width: 50, height: 50)
|
||||
Spacer()
|
||||
}
|
||||
VStack(alignment: .leading, spacing: 8) {
|
||||
Text("Create a local account on your Mac.")
|
||||
.font(.headline)
|
||||
Text("Local accounts store their data on your Mac. They do not sync across your devices.")
|
||||
.font(.callout)
|
||||
.foregroundColor(.secondary)
|
||||
HStack {
|
||||
Text("Name: ")
|
||||
TextField("Account Name", text: $newAccountName)
|
||||
}.padding(.top, 8)
|
||||
Spacer()
|
||||
HStack(spacing: 8) {
|
||||
Spacer()
|
||||
Button(action: {}, label: {
|
||||
Text("Cancel").frame(width: 60)
|
||||
}).keyboardShortcut(.cancelAction)
|
||||
|
||||
Button(action: {}, label: {
|
||||
Text("Create").frame(width: 60)
|
||||
}).keyboardShortcut(.defaultAction)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.frame(width: 384, height: 200)
|
||||
}
|
||||
}
|
||||
|
||||
struct AddLocalAccount_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
AddLocalAccount()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user