look and feel of edit account matches production

This commit is contained in:
Stuart Breckenridge 2020-07-14 11:33:13 +08:00
parent 39a71077b4
commit 64848a9421
No known key found for this signature in database
GPG Key ID: 79BD673276AE83CE
1 changed files with 45 additions and 40 deletions

View File

@ -19,49 +19,13 @@ struct EditAccountView: View {
ZStack {
RoundedRectangle(cornerRadius: 8, style: .circular)
.foregroundColor(Color.secondary.opacity(0.1))
.padding(.top, 8)
VStack {
HStack {
Spacer()
Button("Account Information", action: {})
Spacer()
}.padding(4)
editAccountHeader
if viewModel.account != nil {
Form(content: {
HStack(alignment: .top) {
Text("Type: ")
.frame(width: 50)
VStack(alignment: .leading) {
Text(viewModel.account!.defaultName)
Toggle("Active", isOn: $viewModel.accountIsActive)
}
}
HStack(alignment: .top) {
Text("Name: ")
.frame(width: 50)
VStack(alignment: .leading) {
TextField(viewModel.account!.name ?? "", text: $viewModel.accountName)
.textFieldStyle(RoundedBorderTextFieldStyle())
Text("The name appears in the sidebar. It can be anything you want. You can even use emoji. 🎸")
.foregroundColor(.secondary)
}
}
Spacer()
if viewModel.account?.type != .onMyMac {
HStack {
Spacer()
Button("Credentials", action: {
})
Spacer()
}
}
}).padding()
editAccountForm
}
Spacer()
@ -69,6 +33,47 @@ struct EditAccountView: View {
}
}
var editAccountHeader: some View {
HStack {
Spacer()
Button("Account Information", action: {})
Spacer()
}
.padding([.leading, .trailing, .bottom], 4)
}
var editAccountForm: some View {
Form(content: {
HStack(alignment: .top) {
Text("Type: ")
.frame(width: 50)
VStack(alignment: .leading) {
Text(viewModel.account!.defaultName)
Toggle("Active", isOn: $viewModel.accountIsActive)
}
}
HStack(alignment: .top) {
Text("Name: ")
.frame(width: 50)
VStack(alignment: .leading) {
TextField(viewModel.account!.name ?? "", text: $viewModel.accountName)
.textFieldStyle(RoundedBorderTextFieldStyle())
Text("The name appears in the sidebar. It can be anything you want. You can even use emoji. 🎸")
.foregroundColor(.secondary)
}
}
Spacer()
if viewModel.account?.type != .onMyMac {
HStack {
Spacer()
Button("Credentials", action: {
})
Spacer()
}
}
}).padding()
}
}