Require Face ID to open the app and to send

This commit is contained in:
2026-09-27 23:35:26 +08:00
parent b989b0f791
commit 78e1cefad4
8 changed files with 172 additions and 7 deletions
+44
View File
@@ -0,0 +1,44 @@
import SwiftUI
struct SettingsView: View {
@EnvironmentObject private var model: AppModel
@Environment(\.dismiss) private var dismiss
var body: some View {
ZStack {
Theme.background.ignoresSafeArea()
VStack(alignment: .leading, spacing: 18) {
ScreenHeader(title: "Settings", subtitle: "Security and device options", onBack: { dismiss() })
Card {
Toggle(isOn: Binding(get: { model.faceIDEnabled },
set: { model.faceIDEnabled = $0 })) {
VStack(alignment: .leading, spacing: 3) {
Text("Unlock with \(Biometrics.label)")
.font(.system(size: 15, weight: .semibold))
.foregroundStyle(Theme.text)
Text("Require \(Biometrics.label) to open the app, reveal the recovery phrase, and send payments.")
.font(.system(size: 11))
.foregroundStyle(Theme.muted)
}
}
.tint(Theme.accent)
.disabled(!Biometrics.isAvailable)
if !Biometrics.isAvailable {
Text("This device has no biometric sensor configured.")
.font(.system(size: 11))
.foregroundStyle(Theme.muted)
}
}
Spacer(minLength: 0)
}
.padding(.horizontal, 20)
.padding(.top, 12)
}
.preferredColorScheme(.dark)
.presentationDetents([.medium])
.presentationDragIndicator(.visible)
}
}