Branchwell

Jobley / app · jobley.ai / Apps / iPhone / PhoneSettings.swift

1import SwiftUI
2import JobleyKit
3import JobleyUI
4
5struct PhoneSettings: View {
6 @ObservedObject var curator: CuratorModel
7
8 var body: some View {
9 Form {
10 Section {
11 if let me = curator.me {
12 LabeledContent("Signed in as", value: me.isCurator ? "Curator" : "Moderator · \(me.name)")
13 Button("Sign out", role: .destructive) { curator.signOut() }
14 } else {
15 PasskeySignIn(curator: curator).padding(.vertical, 4)
16 }
17 } header: {
18 Text("Curators and moderators")
19 } footer: {
20 Text("Sign in with your passkey to add the Review tab. Moderators get a one-time setup link when their application is approved.")
21 }
22 if curator.me != nil {
23 Section {
24 PasskeyList(curator: curator)
25 } header: {
26 Text("Passkeys")
27 } footer: {
28 Text("Add a second passkey so you can always get back in. The last one can't be removed.")
29 }
30 }
31 Section("About") {
32 LabeledContent("Version", value: "\(Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String ?? "") (\(Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String ?? ""))")
33 Link("Source code (public domain, Unlicense)", destination: AppLinks.source)
34 Link("Privacy", destination: URL(string: "https://jobley.ai/privacy/")!)
35 Link("What counts as a good job", destination: URL(string: "https://jobley.ai/help/#rules")!)
36 }
37 }
38 .navigationTitle("Settings")
39 }
40}