edit loading

This commit is contained in:
cheykrym 2025-10-26 02:47:58 +03:00
parent 0a7d519567
commit 128ed5723a

View File

@ -25,18 +25,6 @@ struct BlockedUsersView: View {
emptyState emptyState
} else { } else {
usersSection usersSection
if isLoading {
Section {
ProgressView()
.frame(maxWidth: .infinity, alignment: .center)
}
} else if let errorMessage = errorMessageDown {
Text(errorMessage)
.foregroundColor(.red)
.frame(maxWidth: .infinity, alignment: .center)
.listRowSeparator(.hidden)
.listRowBackground(Color.clear)
}
} }
} }
.navigationTitle(NSLocalizedString("Заблокированные", comment: "")) .navigationTitle(NSLocalizedString("Заблокированные", comment: ""))
@ -92,8 +80,25 @@ 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)
}
if isLoading {
ProgressView()
.frame(maxWidth: .infinity, alignment: .center)
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
} else if let errorMessage = errorMessageDown {
Text(errorMessage)
.foregroundColor(.red)
.frame(maxWidth: .infinity, alignment: .center)
.listRowBackground(Color.clear)
.listRowSeparator(.hidden)
}
}
}
private func userRow(_ user: BlockedUser) -> some View {
HStack(spacing: 12) { HStack(spacing: 12) {
Circle() Circle()
.fill(Color.accentColor.opacity(0.15)) .fill(Color.accentColor.opacity(0.15))
@ -132,8 +137,6 @@ struct BlockedUsersView: View {
} }
} }
} }
}
}
private var emptyState: some View { private var emptyState: some View {
VStack(spacing: 12) { VStack(spacing: 12) {