diff --git a/Secretive/CreateSecureEnclaveSecretView.swift b/Secretive/CreateSecureEnclaveSecretView.swift index 6d13b8f..fc627ad 100644 --- a/Secretive/CreateSecureEnclaveSecretView.swift +++ b/Secretive/CreateSecureEnclaveSecretView.swift @@ -2,40 +2,51 @@ import SwiftUI import SecretKit struct CreateSecureEnclaveSecretView: View { - + @ObservedObject var store: SecureEnclave.Store - + @State var name = "" @State var requiresAuthentication = true - + var dismissalBlock: () -> () - + var body: some View { - Form { - Section(header: Text("Secret Name")) { - TextField("Name", text: $name) - } - Section { - Toggle(isOn: $requiresAuthentication) { - Text("Requires Authentication (Biometrics or Password)") - } - } - Section { - HStack { - Spacer() - Button(action: dismissalBlock) { - Text("Cancel") + VStack { + HStack { + Image(nsImage: NSApp.applicationIconImage) + .resizable() + .frame(width: 64, height: 64) + .padding() + VStack { + HStack { + Text("Create a New Secret").bold() + Spacer() + } + HStack { + Text("Name:") + TextField("Name", text: $name) + } + HStack { + Toggle(isOn: $requiresAuthentication) { + Text("Requires Authentication (Biometrics or Password)") + } + Spacer() } - Button(action: save) { - Text("Create") - }.disabled(name.isEmpty) } + .onExitCommand(perform: dismissalBlock) } - } - .padding() - .onExitCommand(perform: dismissalBlock) + HStack { + Spacer() + Button(action: dismissalBlock) { + Text("Cancel") + } + Button(action: save) { + Text("Create") + }.disabled(name.isEmpty) + } + }.padding() } - + func save() { try! store.create(name: name, requiresAuthentication: requiresAuthentication) dismissalBlock()