AddFeedbinAccountView.swift

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

View File

@ -0,0 +1,84 @@
//
// AddFeedbinAccountView.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 AddFeedbinAccountView: 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.feedbin.image()
.resizable()
.frame(width: 50, height: 50)
Spacer()
}
VStack(alignment: .leading, spacing: 8) {
Text("Sign in to your Feedbin account.")
.font(.headline)
HStack {
Text("Don't have a Feedbin account?")
.font(.callout)
Button(action: {
NSWorkspace.shared.open(URL(string: "https://feedbin.com/signup")!)
}, label: {
Text("Sign up here.").font(.callout)
}).buttonStyle(LinkButtonStyle())
}
HStack {
VStack(alignment: .trailing, spacing: 12) {
Text("Email")
Text("Password")
}
VStack {
TextField("me@email.com", text: $username)
SecureField("•••••••••••", text: $password)
}
}
Spacer()
HStack(spacing: 8) {
Spacer()
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: 384, height: 200)
}
}
struct AddFeedbinAccountView_Previews: PreviewProvider {
static var previews: some View {
AddFeedbinAccountView()
}
}

View File

@ -48,6 +48,7 @@
17386BA42577C6240014C8B2 /* RSParser in Frameworks */ = {isa = PBXBuildFile; productRef = 17386BA32577C6240014C8B2 /* RSParser */; };
17386BA52577C6240014C8B2 /* RSParser in Embed Frameworks */ = {isa = PBXBuildFile; productRef = 17386BA32577C6240014C8B2 /* RSParser */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
17386BB62577C7340014C8B2 /* RSCoreResources in Frameworks */ = {isa = PBXBuildFile; productRef = 17386BB52577C7340014C8B2 /* RSCoreResources */; };
17386BC42577CC600014C8B2 /* AddFeedbinAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */; };
173A64172547BE0900267F6E /* AccountType+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 173A64162547BE0900267F6E /* AccountType+Helpers.swift */; };
173A642C2547BE9600267F6E /* AccountType+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 173A64162547BE0900267F6E /* AccountType+Helpers.swift */; };
175942AA24AD533200585066 /* RefreshInterval.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5183CCE4226F4DFA0010922C /* RefreshInterval.swift */; };
@ -1355,6 +1356,7 @@
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 /* AddLocalAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddLocalAccountView.swift; sourceTree = "<group>"; };
17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedbinAccountView.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>"; };
@ -2132,6 +2134,7 @@
isa = PBXGroup;
children = (
17386B792577C4BF0014C8B2 /* AddLocalAccountView.swift */,
17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */,
);
path = Views;
sourceTree = "<group>";
@ -4601,6 +4604,7 @@
51B54AB624B5B33C0014348B /* WebViewController.swift in Sources */,
51E4994B24A8734C00B667CB /* SendToMicroBlogCommand.swift in Sources */,
51E4996F24A8764C00B667CB /* ActivityType.swift in Sources */,
17386BC42577CC600014C8B2 /* AddFeedbinAccountView.swift in Sources */,
51E4994E24A8734C00B667CB /* SendToMarsEditCommand.swift in Sources */,
51919FB024AA8EFA00541E64 /* SidebarItemView.swift in Sources */,
1769E33624BD9621000E1E8E /* EditAccountCredentialsModel.swift in Sources */,