Add an empty view when a tagged user isnt found

Changelog-Added: Show a custom view when tagged user isn't found
This commit is contained in:
ericholguin
2023-04-03 17:07:22 -04:00
committed by William Casarin
parent 8fe8611527
commit 1701dbdfb9
3 changed files with 51 additions and 5 deletions

View File

@@ -74,11 +74,16 @@ struct UserSearch: View {
var body: some View {
ScrollView {
LazyVStack {
ForEach(users) { user in
UserView(damus_state: damus_state, pubkey: user.pubkey)
.onTapGesture {
on_user_tapped(user: user)
}
Divider()
if users.count == 0 {
EmptyUserSearchView()
} else {
ForEach(users) { user in
UserView(damus_state: damus_state, pubkey: user.pubkey)
.onTapGesture {
on_user_tapped(user: user)
}
}
}
}
}