mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
AddFeedbinAccountView.swift
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user