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