AddFeedWranglerAccountView

This commit is contained in:
Stuart Breckenridge 2020-12-03 13:15:00 +08:00
parent c88989d07e
commit 8ba6c5fc18
No known key found for this signature in database
GPG Key ID: 1F11FD62007DC331
3 changed files with 96 additions and 1 deletions

View File

@ -0,0 +1,90 @@
//
// AddFeedWranglerAccountView.swift
// Multiplatform macOS
//
// Created by Stuart Breckenridge on 03/12/2020.
// Copyright © 2020 Ranchero Software. All rights reserved.
//
import SwiftUI
import Account
struct AddFeedWranglerAccountView: View {
@Environment (\.presentationMode) var presentationMode
@State private var username: String = ""
@State private var password: String = ""
var body: some View {
VStack {
HStack(spacing: 16) {
VStack(alignment: .leading) {
AccountType.feedWrangler.image()
.resizable()
.frame(width: 50, height: 50)
Spacer()
}
VStack(alignment: .leading, spacing: 8) {
Text("Sign in to your Feed Wrangler account.")
.font(.headline)
HStack {
Text("Don't have a Feed Wrangler account?")
.font(.callout)
Button(action: {
NSWorkspace.shared.open(URL(string: "https://feedwrangler.net/users/new")!)
}, label: {
Text("Sign up here.").font(.callout)
}).buttonStyle(LinkButtonStyle())
}
HStack {
VStack(alignment: .trailing, spacing: 14) {
Text("Email")
Text("Password")
}
VStack(spacing: 8) {
TextField("me@email.com", text: $username)
SecureField("•••••••••••", text: $password)
}
}
Text("Your username and password will be encrypted and stored in Keychain.")
.foregroundColor(.secondary)
.font(.callout)
.lineLimit(2)
.padding(.top, 4)
Spacer()
HStack(spacing: 8) {
Spacer()
ProgressView().scaleEffect(CGSize(width: 0.5, height: 0.5))
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {
Text("Cancel")
.frame(width: 60)
}).keyboardShortcut(.cancelAction)
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {
Text("Create")
.frame(width: 60)
})
.keyboardShortcut(.defaultAction)
.disabled(username.isEmpty && password.isEmpty)
}
}
}
}
.padding()
.frame(width: 400, height: 220)
.textFieldStyle(RoundedBorderTextFieldStyle())
}
}
struct AddFeedWranglerAccountView_Previews: PreviewProvider {
static var previews: some View {
AddFeedWranglerAccountView()
}
}

View File

@ -58,6 +58,7 @@ struct AddFeedbinAccountView: View {
Spacer()
HStack(spacing: 8) {
Spacer()
ProgressView().scaleEffect(CGSize(width: 0.5, height: 0.5))
Button(action: {
presentationMode.wrappedValue.dismiss()
}, label: {

View File

@ -1099,6 +1099,7 @@
D5F4EDB920074D7C00B9E363 /* Folder+Scriptability.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5F4EDB820074D7C00B9E363 /* Folder+Scriptability.swift */; };
DD82AB0A231003F6002269DF /* SharingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD82AB09231003F6002269DF /* SharingTests.swift */; };
DF98E29A2578A73A00F18944 /* AddCloudKitAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF98E2992578A73A00F18944 /* AddCloudKitAccountView.swift */; };
DF98E2B02578AA5C00F18944 /* AddFeedWranglerAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF98E2AF2578AA5C00F18944 /* AddFeedWranglerAccountView.swift */; };
FA80C11724B0728000974098 /* AddFolderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA80C11624B0728000974098 /* AddFolderView.swift */; };
FA80C11824B0728000974098 /* AddFolderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA80C11624B0728000974098 /* AddFolderView.swift */; };
FA80C13E24B072AA00974098 /* AddFolderModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = FA80C13D24B072AA00974098 /* AddFolderModel.swift */; };
@ -1934,6 +1935,7 @@
D5F4EDB820074D7C00B9E363 /* Folder+Scriptability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Folder+Scriptability.swift"; sourceTree = "<group>"; };
DD82AB09231003F6002269DF /* SharingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingTests.swift; sourceTree = "<group>"; };
DF98E2992578A73A00F18944 /* AddCloudKitAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddCloudKitAccountView.swift; sourceTree = "<group>"; };
DF98E2AF2578AA5C00F18944 /* AddFeedWranglerAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedWranglerAccountView.swift; sourceTree = "<group>"; };
FA80C11624B0728000974098 /* AddFolderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFolderView.swift; sourceTree = "<group>"; };
FA80C13D24B072AA00974098 /* AddFolderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFolderModel.swift; sourceTree = "<group>"; };
FF3ABF09232599450074C542 /* ArticleSorterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorterTests.swift; sourceTree = "<group>"; };
@ -2136,8 +2138,9 @@
isa = PBXGroup;
children = (
17386B792577C4BF0014C8B2 /* AddLocalAccountView.swift */,
17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */,
DF98E2992578A73A00F18944 /* AddCloudKitAccountView.swift */,
17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */,
DF98E2AF2578AA5C00F18944 /* AddFeedWranglerAccountView.swift */,
);
path = Views;
sourceTree = "<group>";
@ -4641,6 +4644,7 @@
51E4990624A808C300B667CB /* ImageDownloader.swift in Sources */,
51E4994F24A8734C00B667CB /* TwitterFeedProvider-Extensions.swift in Sources */,
51E498CA24A8085D00B667CB /* SmartFeedDelegate.swift in Sources */,
DF98E2B02578AA5C00F18944 /* AddFeedWranglerAccountView.swift in Sources */,
5177470A24B2F87600EB0F74 /* SidebarListStyleModifier.swift in Sources */,
1769E33824BD97CB000E1E8E /* AccountUpdateErrors.swift in Sources */,
51E4990524A808C300B667CB /* FeaturedImageDownloader.swift in Sources */,