patch
This commit is contained in:
parent
bbe6a8a3e4
commit
cd67c350b4
@ -6,6 +6,9 @@
|
||||
},
|
||||
"(без текста)" : {
|
||||
|
||||
},
|
||||
"@" : {
|
||||
|
||||
},
|
||||
"@%@" : {
|
||||
"localizations" : {
|
||||
|
||||
@ -148,10 +148,10 @@ struct PasswordLoginView: View {
|
||||
}
|
||||
|
||||
VStack(alignment: .leading, spacing: 12) {
|
||||
HStack(spacing: 8) {
|
||||
Text("@")
|
||||
.foregroundColor(.secondary)
|
||||
TextField(NSLocalizedString("Введите логин", comment: ""), text: $viewModel.username)
|
||||
.padding()
|
||||
.background(Color(.secondarySystemBackground))
|
||||
.cornerRadius(12)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.focused($focusedField, equals: .username)
|
||||
@ -160,6 +160,10 @@ struct PasswordLoginView: View {
|
||||
viewModel.username = String(newValue.prefix(32))
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(Color(.secondarySystemBackground))
|
||||
.cornerRadius(12)
|
||||
|
||||
if !isUsernameValid && !viewModel.username.isEmpty {
|
||||
Text(NSLocalizedString("Неверный логин", comment: "Неверный логин"))
|
||||
@ -412,20 +416,24 @@ private struct PasswordlessRequestView: View {
|
||||
// Text(NSLocalizedString("Логин", comment: ""))
|
||||
// .font(.subheadline)
|
||||
// .foregroundColor(.secondary)
|
||||
HStack(spacing: 8) {
|
||||
Text("@")
|
||||
.foregroundColor(.secondary)
|
||||
TextField(NSLocalizedString("Введите логин", comment: ""), text: $viewModel.passwordlessLogin)
|
||||
.textContentType(.username)
|
||||
.keyboardType(.default)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.padding()
|
||||
.background(Color(.secondarySystemBackground))
|
||||
.cornerRadius(12)
|
||||
.focused($isFieldFocused)
|
||||
.onChange(of: viewModel.passwordlessLogin) { newValue in
|
||||
if newValue.count > 32 {
|
||||
viewModel.passwordlessLogin = String(newValue.prefix(32))
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(Color(.secondarySystemBackground))
|
||||
.cornerRadius(12)
|
||||
if !isLoginValid && !viewModel.passwordlessLogin.isEmpty {
|
||||
Text(NSLocalizedString("Неверный логин", comment: ""))
|
||||
.foregroundColor(.red)
|
||||
|
||||
@ -75,18 +75,22 @@ struct RegistrationView: View {
|
||||
|
||||
Group {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
HStack(spacing: 8) {
|
||||
Text("@")
|
||||
.foregroundColor(.secondary)
|
||||
TextField(NSLocalizedString("Введите логин", comment: "Логин"), text: $username)
|
||||
.autocapitalization(.none)
|
||||
.disableAutocorrection(true)
|
||||
.focused($focusedField, equals: .username)
|
||||
.padding()
|
||||
.background(Color(.secondarySystemBackground))
|
||||
.cornerRadius(12)
|
||||
.onChange(of: username) { newValue in
|
||||
if newValue.count > 32 {
|
||||
username = String(newValue.prefix(32))
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.background(Color(.secondarySystemBackground))
|
||||
.cornerRadius(12)
|
||||
|
||||
if !isUsernameValid && !username.isEmpty {
|
||||
Text(NSLocalizedString("Логин должен быть от 3 до 32 символов (английские буквы, цифры, _)", comment: ""))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user