Add an iPhone client sharing the macOS app's SwiftUI code
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import AppKit
|
||||
import ByreAPI
|
||||
import SwiftUI
|
||||
|
||||
@@ -12,6 +11,7 @@ let tabLabels: [TaskTab: String] = [
|
||||
.workflow: "Workflow",
|
||||
]
|
||||
|
||||
#if os(macOS)
|
||||
struct HalfSplit: Layout {
|
||||
func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {
|
||||
proposal.replacingUnspecifiedDimensions()
|
||||
@@ -71,6 +71,7 @@ struct MainView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct PaneTabButton: View {
|
||||
let label: String
|
||||
@@ -100,6 +101,7 @@ struct PaneTabButton: View {
|
||||
}
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
private struct LeftPane: View {
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@@ -218,6 +220,7 @@ private struct TaskPane: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
struct TaskTabBody: View {
|
||||
let tab: TaskTab
|
||||
@@ -246,7 +249,7 @@ struct TaskTabBody: View {
|
||||
}
|
||||
}
|
||||
|
||||
private struct TaskBar: View {
|
||||
struct TaskBar: View {
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@Environment(\.paneAccent) private var accent
|
||||
@@ -361,7 +364,7 @@ private struct PreviewLink: View {
|
||||
}
|
||||
}
|
||||
|
||||
private struct TabStrip: View {
|
||||
struct TabStrip: View {
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@Environment(\.paneAccent) private var accent
|
||||
@@ -503,7 +506,7 @@ private struct MoreButton: View {
|
||||
|
||||
private let emailShape = Re(#"^[^@\s]+@[^@\s]+$"#)
|
||||
|
||||
private struct IdentityBanner: View {
|
||||
struct IdentityBanner: View {
|
||||
@Environment(Store.self) private var store
|
||||
@Environment(Overlays.self) private var overlays
|
||||
@ViewState private var name: String?
|
||||
@@ -513,17 +516,18 @@ private struct IdentityBanner: View {
|
||||
if let me = store.me, me.gitName.isEmpty || me.gitEmail.isEmpty {
|
||||
let gitName = name ?? me.displayName
|
||||
let valid = !gitName.isEmpty && emailShape.test(email)
|
||||
HStack(spacing: 6) {
|
||||
let row = touchOnly ? AnyLayout(VStackLayout(alignment: .leading, spacing: 6)) : AnyLayout(HStackLayout(spacing: 6))
|
||||
row {
|
||||
Text("Set the identity agents commit as: ")
|
||||
TextField("Git name", text: Binding(get: { gitName }, set: { name = $0 }))
|
||||
.modifier(FieldStyle())
|
||||
.frame(width: 220)
|
||||
.frame(width: touchOnly ? nil : 220)
|
||||
.onSubmit {
|
||||
save(gitName, valid)
|
||||
}
|
||||
TextField("Git email", text: $email)
|
||||
.modifier(FieldStyle())
|
||||
.frame(width: 260)
|
||||
.frame(width: touchOnly ? nil : 260)
|
||||
.onSubmit {
|
||||
save(gitName, valid)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user