Update Settings for Accounts to work with the latest SwiftUI

This commit is contained in:
Maurice Parker
2019-09-07 20:50:57 -05:00
parent a01b9ebe73
commit fe874f3ca7
8 changed files with 215 additions and 170 deletions

View File

@@ -10,7 +10,7 @@ import SwiftUI
import Account
struct SettingsLocalAccountView : View {
@Environment(\.isPresented) private var isPresented
@Environment(\.presentationMode) var presentation
@State var name: String
var body: some View {
@@ -20,9 +20,7 @@ struct SettingsLocalAccountView : View {
SettingsAccountLabelView(accountImage: "accountLocal", accountLabel: Account.defaultLocalAccountName).padding()
) {
HStack {
Text("Name")
Divider()
TextField($name, placeholder: Text("(Optional)"))
TextField("Name", text: $name)
}
}
Section {
@@ -47,7 +45,7 @@ struct SettingsLocalAccountView : View {
}
private func dismiss() {
isPresented?.value = false
presentation.wrappedValue.dismiss()
}
}