Changed checkbox to radio button for clearer UI. (#210)
This commit is contained in:
parent
dca340ad40
commit
42b034270a
|
@ -2,10 +2,10 @@ import SwiftUI
|
||||||
import SecretKit
|
import SecretKit
|
||||||
|
|
||||||
struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
||||||
|
|
||||||
@ObservedObject var store: StoreType
|
@ObservedObject var store: StoreType
|
||||||
@Binding var showing: Bool
|
@Binding var showing: Bool
|
||||||
|
|
||||||
@State private var name = ""
|
@State private var name = ""
|
||||||
@State private var requiresAuthentication = true
|
@State private var requiresAuthentication = true
|
||||||
|
|
||||||
|
@ -26,8 +26,12 @@ struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
||||||
TextField("Shhhhh", text: $name).focusable()
|
TextField("Shhhhh", text: $name).focusable()
|
||||||
}
|
}
|
||||||
HStack {
|
HStack {
|
||||||
Toggle(isOn: $requiresAuthentication) {
|
VStack(spacing: 20) {
|
||||||
Text("Requires Authentication (Biometrics or Password)")
|
Picker("", selection: $requiresAuthentication) {
|
||||||
|
Text("Requires Authentication (Biometrics or Password) before each use").tag(true)
|
||||||
|
Text("Authentication not required when Mac is unlocked").tag(false)
|
||||||
|
}
|
||||||
|
.pickerStyle(RadioGroupPickerStyle())
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
@ -45,7 +49,7 @@ struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
||||||
}
|
}
|
||||||
}.padding()
|
}.padding()
|
||||||
}
|
}
|
||||||
|
|
||||||
func save() {
|
func save() {
|
||||||
try! store.create(name: name, requiresAuthentication: requiresAuthentication)
|
try! store.create(name: name, requiresAuthentication: requiresAuthentication)
|
||||||
showing = false
|
showing = false
|
||||||
|
|
Loading…
Reference in New Issue