AddLocalAccountView.swift

This commit is contained in:
Stuart Breckenridge 2020-12-02 21:19:33 +08:00
parent 21a9d3d3dc
commit 2bfeeda239
No known key found for this signature in database
GPG Key ID: 1F11FD62007DC331
2 changed files with 21 additions and 12 deletions

View File

@ -1,5 +1,5 @@
//
// AddLocalAccount.swift
// AddLocalAccountView.swift
// Multiplatform macOS
//
// Created by Stuart Breckenridge on 02/12/2020.
@ -10,9 +10,10 @@ import SwiftUI
import Account
import RSCore
struct AddLocalAccount: View {
struct AddLocalAccountView: View {
@State private var newAccountName: String = ""
@Environment (\.presentationMode) var presentationMode
var body: some View {
VStack {
@ -36,12 +37,20 @@ struct AddLocalAccount: View {
Spacer()
HStack(spacing: 8) {
Spacer()
Button(action: {}, label: {
Text("Cancel").frame(width: 60)
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {
Text("Cancel")
.frame(width: 60)
}).keyboardShortcut(.cancelAction)
Button(action: {}, label: {
Text("Create").frame(width: 60)
Button(action: {
let newAccount = AccountManager.shared.createAccount(type: .onMyMac)
newAccount.name = newAccountName
presentationMode.wrappedValue.dismiss()
}, label: {
Text("Create")
.frame(width: 60)
}).keyboardShortcut(.defaultAction)
}
}
@ -54,6 +63,6 @@ struct AddLocalAccount: View {
struct AddLocalAccount_Previews: PreviewProvider {
static var previews: some View {
AddLocalAccount()
AddLocalAccountView()
}
}

View File

@ -36,7 +36,7 @@
1729529B24AA1FD200D65E66 /* MacSearchField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1729529A24AA1FD200D65E66 /* MacSearchField.swift */; };
17386B5E2577BC820014C8B2 /* AccountType+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 173A64162547BE0900267F6E /* AccountType+Helpers.swift */; };
17386B6C2577BD820014C8B2 /* RSSparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 17386B6B2577BD820014C8B2 /* RSSparkle */; };
17386B7A2577C4BF0014C8B2 /* AddLocalAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17386B792577C4BF0014C8B2 /* AddLocalAccount.swift */; };
17386B7A2577C4BF0014C8B2 /* AddLocalAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17386B792577C4BF0014C8B2 /* AddLocalAccountView.swift */; };
17386B952577C6240014C8B2 /* RSCore in Frameworks */ = {isa = PBXBuildFile; productRef = 17386B942577C6240014C8B2 /* RSCore */; };
17386B962577C6240014C8B2 /* RSCore in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 17386B942577C6240014C8B2 /* RSCore */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
17386B982577C6240014C8B2 /* RSTree in Frameworks */ = {isa = PBXBuildFile; productRef = 17386B972577C6240014C8B2 /* RSTree */; };
@ -1354,7 +1354,7 @@
1729529224AA1CAA00D65E66 /* GeneralPreferencesView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneralPreferencesView.swift; sourceTree = "<group>"; };
1729529624AA1CD000D65E66 /* MacPreferencePanes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MacPreferencePanes.swift; sourceTree = "<group>"; };
1729529A24AA1FD200D65E66 /* MacSearchField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacSearchField.swift; sourceTree = "<group>"; };
17386B792577C4BF0014C8B2 /* AddLocalAccount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddLocalAccount.swift; sourceTree = "<group>"; };
17386B792577C4BF0014C8B2 /* AddLocalAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddLocalAccountView.swift; sourceTree = "<group>"; };
173A64162547BE0900267F6E /* AccountType+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AccountType+Helpers.swift"; sourceTree = "<group>"; };
176813B62564B9F800D98635 /* WidgetData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetData.swift; sourceTree = "<group>"; };
176813BD2564BA2800D98635 /* WidgetDataEncoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetDataEncoder.swift; sourceTree = "<group>"; };
@ -2131,7 +2131,7 @@
17386B812577C4C60014C8B2 /* Views */ = {
isa = PBXGroup;
children = (
17386B792577C4BF0014C8B2 /* AddLocalAccount.swift */,
17386B792577C4BF0014C8B2 /* AddLocalAccountView.swift */,
);
path = Views;
sourceTree = "<group>";
@ -4610,7 +4610,7 @@
17E4DBD624BFC53E00FE462A /* AdvancedPreferencesModel.swift in Sources */,
5177470724B2910300EB0F74 /* ArticleToolbarModifier.swift in Sources */,
FA80C11824B0728000974098 /* AddFolderView.swift in Sources */,
17386B7A2577C4BF0014C8B2 /* AddLocalAccount.swift in Sources */,
17386B7A2577C4BF0014C8B2 /* AddLocalAccountView.swift in Sources */,
51E4996C24A8762D00B667CB /* ExtractedArticle.swift in Sources */,
51E4990824A808C300B667CB /* RSHTMLMetadata+Extension.swift in Sources */,
51919FF824AB8B7700541E64 /* TimelineView.swift in Sources */,