1
0
mirror of git://jb55.com/damus synced 2024-10-06 11:43:21 +00:00

createaccount: ui: refactor signup form

This commit is contained in:
ericholguin 2023-05-26 19:52:10 -06:00 committed by William Casarin
parent eb72fb481c
commit ff06cfaf0c

View File

@ -30,31 +30,6 @@ struct CreateAccountView: View {
} }
VStack { VStack {
HStack(alignment: .top) {
VStack {
Text(verbatim: " ")
.foregroundColor(.white)
}
VStack {
SignupForm {
FormLabel(NSLocalizedString("Display Name", comment: "Label to prompt display name entry."), optional: true)
FormTextInput(NSLocalizedString("Satoshi Nakamoto", comment: "Name of Bitcoin creator(s)."), text: $account.real_name)
.textInputAutocapitalization(.words)
FormLabel(NSLocalizedString("About", comment: "Label to prompt for about text entry for user to describe about themself."), optional: true)
FormTextInput(NSLocalizedString("Creator(s) of Bitcoin. Absolute legend.", comment: "Example description about Bitcoin creator(s), Satoshi Nakamoto."), text: $account.about)
FormLabel(NSLocalizedString("Account ID", comment: "Label to indicate the public ID of the account."))
.onTapGesture {
regen_key()
}
KeyText($account.pubkey)
.onTapGesture {
regen_key()
}
VStack(alignment: .center) { VStack(alignment: .center) {
ProfilePictureSelector(pubkey: account.pubkey, viewModel: profileUploadViewModel, callback: uploadedProfilePicture(image_url:)) ProfilePictureSelector(pubkey: account.pubkey, viewModel: profileUploadViewModel, callback: uploadedProfilePicture(image_url:))
@ -71,13 +46,22 @@ struct CreateAccountView: View {
regen_key() regen_key()
} }
} }
}
.frame(minWidth: 300, maxWidth: .infinity, minHeight: 300, alignment: .center) .frame(minWidth: 300, maxWidth: .infinity, minHeight: 300, alignment: .center)
.background { .background {
RoundedRectangle(cornerRadius: 12) RoundedRectangle(cornerRadius: 12)
.fill(DamusColors.adaptableGrey, strokeBorder: .gray.opacity(0.5), lineWidth: 1) .fill(DamusColors.adaptableGrey, strokeBorder: .gray.opacity(0.5), lineWidth: 1)
} }
SignupForm {
FormLabel(NSLocalizedString("Display name", comment: "Label to prompt display name entry."), optional: true)
FormTextInput(NSLocalizedString("Satoshi Nakamoto", comment: "Name of Bitcoin creator(s)."), text: $account.real_name)
.textInputAutocapitalization(.words)
FormLabel(NSLocalizedString("About", comment: "Label to prompt for about text entry for user to describe about themself."), optional: true)
FormTextInput(NSLocalizedString("Creator(s) of Bitcoin. Absolute legend.", comment: "Example description about Bitcoin creator(s), Satoshi Nakamoto."), text: $account.about)
}
.padding(.top, 10)
Button(action: { Button(action: {
self.is_done = true self.is_done = true
}) { }) {