From b9299329cb254c150af5317665188a6da625f50d Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Wed, 2 Dec 2020 21:40:26 +0800 Subject: [PATCH] AddFeedbinAccountView.swift --- .../Views/AddFeedbinAccountView.swift | 84 +++++++++++++++++++ NetNewsWire.xcodeproj/project.pbxproj | 4 + 2 files changed, 88 insertions(+) create mode 100644 Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddFeedbinAccountView.swift diff --git a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddFeedbinAccountView.swift b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddFeedbinAccountView.swift new file mode 100644 index 000000000..8e9d6a876 --- /dev/null +++ b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddFeedbinAccountView.swift @@ -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() + } +} diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index 34a39486e..29c020957 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -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 = ""; }; 1729529A24AA1FD200D65E66 /* MacSearchField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MacSearchField.swift; sourceTree = ""; }; 17386B792577C4BF0014C8B2 /* AddLocalAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddLocalAccountView.swift; sourceTree = ""; }; + 17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedbinAccountView.swift; sourceTree = ""; }; 173A64162547BE0900267F6E /* AccountType+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "AccountType+Helpers.swift"; sourceTree = ""; }; 176813B62564B9F800D98635 /* WidgetData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetData.swift; sourceTree = ""; }; 176813BD2564BA2800D98635 /* WidgetDataEncoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetDataEncoder.swift; sourceTree = ""; }; @@ -2132,6 +2134,7 @@ isa = PBXGroup; children = ( 17386B792577C4BF0014C8B2 /* AddLocalAccountView.swift */, + 17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */, ); path = Views; sourceTree = ""; @@ -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 */,