diff --git a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/EditAccountView.swift b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/EditAccountView.swift index e45650de0..6999f22b0 100644 --- a/Multiplatform/macOS/Preferences/Preference Panes/Accounts/EditAccountView.swift +++ b/Multiplatform/macOS/Preferences/Preference Panes/Accounts/EditAccountView.swift @@ -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() + } }