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 index a2f92e71a..1dd1b0b61 100644 --- 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 @@ -79,7 +79,7 @@ struct AddFeedbinAccountView: View { } } .padding() - .frame(width: 384, height: 220) + .frame(width: 384, height: 230) .textFieldStyle(RoundedBorderTextFieldStyle()) } } diff --git a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddLocalAccountView.swift b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddLocalAccountView.swift index 0704fbfa4..368f7d825 100644 --- a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddLocalAccountView.swift +++ b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddLocalAccountView.swift @@ -57,7 +57,7 @@ struct AddLocalAccountView: View { } } .padding() - .frame(width: 384, height: 200) + .frame(width: 384, height: 230) .textFieldStyle(RoundedBorderTextFieldStyle()) } } diff --git a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddNewsBlurAccountView.swift b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddNewsBlurAccountView.swift new file mode 100644 index 000000000..59c83189f --- /dev/null +++ b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/Account Preferences/Add Account/Views/AddNewsBlurAccountView.swift @@ -0,0 +1,90 @@ +// +// AddNewsBlurAccountView.swift +// Multiplatform macOS +// +// Created by Stuart Breckenridge on 03/12/2020. +// Copyright © 2020 Ranchero Software. All rights reserved. +// + +import SwiftUI +import Account + +struct AddNewsBlurAccountView: 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.newsBlur.image() + .resizable() + .frame(width: 50, height: 50) + Spacer() + } + VStack(alignment: .leading, spacing: 8) { + Text("Sign in to your NewsBlur account.") + .font(.headline) + HStack { + Text("Don't have a NewsBlur account?") + .font(.callout) + Button(action: { + NSWorkspace.shared.open(URL(string: "https://newsblur.com")!) + }, 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: 230) + .textFieldStyle(RoundedBorderTextFieldStyle()) + } +} + +struct AddNewsBlurAccountView_Previews: PreviewProvider { + static var previews: some View { + AddNewsBlurAccountView() + } +} diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index e1cd5bb4d..688062069 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -1100,6 +1100,7 @@ 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 */; }; + DF98E2BE2578AC0000F18944 /* AddNewsBlurAccountView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DF98E2BD2578AC0000F18944 /* AddNewsBlurAccountView.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 */; }; @@ -1936,6 +1937,7 @@ DD82AB09231003F6002269DF /* SharingTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SharingTests.swift; sourceTree = ""; }; DF98E2992578A73A00F18944 /* AddCloudKitAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddCloudKitAccountView.swift; sourceTree = ""; }; DF98E2AF2578AA5C00F18944 /* AddFeedWranglerAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFeedWranglerAccountView.swift; sourceTree = ""; }; + DF98E2BD2578AC0000F18944 /* AddNewsBlurAccountView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddNewsBlurAccountView.swift; sourceTree = ""; }; FA80C11624B0728000974098 /* AddFolderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFolderView.swift; sourceTree = ""; }; FA80C13D24B072AA00974098 /* AddFolderModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddFolderModel.swift; sourceTree = ""; }; FF3ABF09232599450074C542 /* ArticleSorterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArticleSorterTests.swift; sourceTree = ""; }; @@ -2141,6 +2143,7 @@ DF98E2992578A73A00F18944 /* AddCloudKitAccountView.swift */, 17386BC32577CC600014C8B2 /* AddFeedbinAccountView.swift */, DF98E2AF2578AA5C00F18944 /* AddFeedWranglerAccountView.swift */, + DF98E2BD2578AC0000F18944 /* AddNewsBlurAccountView.swift */, ); path = Views; sourceTree = ""; @@ -4631,6 +4634,7 @@ 514E6C0724AD2B5F00AC6F6E /* Image-Extensions.swift in Sources */, 51E4994D24A8734C00B667CB /* ExtensionPointIdentifer.swift in Sources */, 51C65AFD24CCB2C9008EB3BD /* TimelineItems.swift in Sources */, + DF98E2BE2578AC0000F18944 /* AddNewsBlurAccountView.swift in Sources */, 51B54A6724B549FE0014348B /* ArticleIconSchemeHandler.swift in Sources */, 51E4992224A8095600B667CB /* URL-Extensions.swift in Sources */, 51E4990424A808C300B667CB /* WebFeedIconDownloader.swift in Sources */,