Compare commits
4 Commits
9f6beecb49
...
526a57b556
| Author | SHA1 | Date | |
|---|---|---|---|
| 526a57b556 | |||
| 7f73216936 | |||
| 128ed5723a | |||
| 0a7d519567 |
@ -94,9 +94,6 @@
|
|||||||
},
|
},
|
||||||
"Email не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : {
|
"Email не подтверждён. Подтвердите, чтобы активировать дополнительные проверки." : {
|
||||||
"comment" : "Описание необходимости подтверждения email"
|
"comment" : "Описание необходимости подтверждения email"
|
||||||
},
|
|
||||||
"error" : {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
"Fun Fest" : {
|
"Fun Fest" : {
|
||||||
"comment" : "Fun Fest",
|
"comment" : "Fun Fest",
|
||||||
@ -644,6 +641,9 @@
|
|||||||
},
|
},
|
||||||
"Значение сохранено в буфере обмена." : {
|
"Значение сохранено в буфере обмена." : {
|
||||||
"comment" : "Сообщение после копирования"
|
"comment" : "Сообщение после копирования"
|
||||||
|
},
|
||||||
|
"Идет загрузка..." : {
|
||||||
|
|
||||||
},
|
},
|
||||||
"Идея" : {
|
"Идея" : {
|
||||||
"comment" : "feedback category: idea",
|
"comment" : "feedback category: idea",
|
||||||
|
|||||||
@ -25,14 +25,6 @@ struct BlockedUsersView: View {
|
|||||||
emptyState
|
emptyState
|
||||||
} else {
|
} else {
|
||||||
usersSection
|
usersSection
|
||||||
if isLoading {
|
|
||||||
Section {
|
|
||||||
ProgressView()
|
|
||||||
.frame(maxWidth: .infinity, alignment: .center)
|
|
||||||
}
|
|
||||||
} else if errorMessageDown != nil{
|
|
||||||
Text("error")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.navigationTitle(NSLocalizedString("Заблокированные", comment: ""))
|
.navigationTitle(NSLocalizedString("Заблокированные", comment: ""))
|
||||||
@ -88,44 +80,60 @@ struct BlockedUsersView: View {
|
|||||||
|
|
||||||
private var usersSection: some View {
|
private var usersSection: some View {
|
||||||
Section(header: Text(NSLocalizedString("Заблокированные", comment: ""))) {
|
Section(header: Text(NSLocalizedString("Заблокированные", comment: ""))) {
|
||||||
ForEach(blockedUsers) {
|
ForEach(blockedUsers) { user in
|
||||||
user in
|
userRow(user)
|
||||||
HStack(spacing: 12) {
|
}
|
||||||
Circle()
|
if isLoading {
|
||||||
.fill(Color.accentColor.opacity(0.15))
|
Text("Идет загрузка...")
|
||||||
.frame(width: 44, height: 44)
|
.foregroundColor(.gray)
|
||||||
.overlay(
|
.frame(maxWidth: .infinity, alignment: .center)
|
||||||
Text(user.initials)
|
.listRowBackground(Color.clear)
|
||||||
.font(.headline)
|
.listRowSeparator(.hidden)
|
||||||
.foregroundColor(.accentColor)
|
} else if let errorMessage = errorMessageDown {
|
||||||
)
|
Text(errorMessage)
|
||||||
VStack(alignment: .leading, spacing: 4) {
|
.foregroundColor(.red)
|
||||||
Text(user.displayName)
|
.frame(maxWidth: .infinity, alignment: .center)
|
||||||
.font(.body)
|
.listRowBackground(Color.clear)
|
||||||
if let handle = user.handle {
|
.listRowSeparator(.hidden)
|
||||||
Text(handle)
|
}
|
||||||
.font(.caption)
|
}
|
||||||
.foregroundColor(.secondary)
|
}
|
||||||
}
|
|
||||||
}
|
private func userRow(_ user: BlockedUser) -> some View {
|
||||||
Spacer()
|
HStack(spacing: 12) {
|
||||||
|
Circle()
|
||||||
|
.fill(Color.accentColor.opacity(0.15))
|
||||||
|
.frame(width: 44, height: 44)
|
||||||
|
.overlay(
|
||||||
|
Text(user.initials)
|
||||||
|
.font(.headline)
|
||||||
|
.foregroundColor(.accentColor)
|
||||||
|
)
|
||||||
|
VStack(alignment: .leading, spacing: 4) {
|
||||||
|
Text(user.displayName)
|
||||||
|
.font(.body)
|
||||||
|
if let handle = user.handle {
|
||||||
|
Text(handle)
|
||||||
|
.font(.caption)
|
||||||
|
.foregroundColor(.secondary)
|
||||||
}
|
}
|
||||||
.padding(.vertical, 0)
|
}
|
||||||
.swipeActions(edge: .trailing) {
|
Spacer()
|
||||||
Button(role: .destructive) {
|
}
|
||||||
pendingUnblock = user
|
.padding(.vertical, 0)
|
||||||
showUnblockConfirmation = true
|
.swipeActions(edge: .trailing) {
|
||||||
} label: {
|
Button(role: .destructive) {
|
||||||
Label(NSLocalizedString("Разблокировать", comment: ""), systemImage: "person.crop.circle.badge.xmark")
|
pendingUnblock = user
|
||||||
}
|
showUnblockConfirmation = true
|
||||||
.disabled(removingUserIds.contains(user.id))
|
} label: {
|
||||||
}
|
Label(NSLocalizedString("Разблокировать", comment: ""), systemImage: "person.crop.circle.badge.xmark")
|
||||||
.onAppear {
|
}
|
||||||
if user.id == blockedUsers.last?.id {
|
.disabled(removingUserIds.contains(user.id))
|
||||||
Task {
|
}
|
||||||
await loadBlockedUsers()
|
.onAppear {
|
||||||
}
|
if user.id == blockedUsers.last?.id {
|
||||||
}
|
Task {
|
||||||
|
await loadBlockedUsers()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -185,7 +193,7 @@ struct BlockedUsersView: View {
|
|||||||
if offset == 0 {
|
if offset == 0 {
|
||||||
loadError = message
|
loadError = message
|
||||||
}
|
}
|
||||||
activeAlert = .error(message: message)
|
// activeAlert = .error(message: message)
|
||||||
errorMessageDown = message
|
errorMessageDown = message
|
||||||
if AppConfig.DEBUG { print("[BlockedUsersView] load blocked users failed: \(error)") }
|
if AppConfig.DEBUG { print("[BlockedUsersView] load blocked users failed: \(error)") }
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user