mirror of
https://github.com/lumaa-dev/BubbleApp.git
synced 2025-02-07 15:38:47 +01:00
Errors and loading
This commit is contained in:
parent
7121a6185c
commit
c99f185205
@ -5,17 +5,19 @@ import SwiftUI
|
||||
struct EmojiSelector: View {
|
||||
@Environment(AccountManager.self) private var accountManager
|
||||
|
||||
@State private var loading: Bool = true
|
||||
@State private var emojiContainers: [CategorizedEmojiContainer] = []
|
||||
|
||||
@Binding var viewModel: PostingView.ViewModel
|
||||
|
||||
var body: some View {
|
||||
if emojiContainers.isEmpty {
|
||||
if loading {
|
||||
ProgressView()
|
||||
.ignoresSafeArea()
|
||||
.task {
|
||||
await fetchCustomEmojis()
|
||||
}
|
||||
} else {
|
||||
} else if !loading && !emojiContainers.isEmpty {
|
||||
ScrollView(.vertical, showsIndicators: false) {
|
||||
ForEach(emojiContainers) { container in
|
||||
LazyVGrid(columns: [.init(.adaptive(minimum: 40, maximum: 40))]) {
|
||||
@ -34,6 +36,8 @@ struct EmojiSelector: View {
|
||||
}
|
||||
.padding()
|
||||
.padding(.vertical)
|
||||
} else {
|
||||
ContentUnavailableView("status.posting.no-emojis", systemImage: "network.slash")
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -611,6 +611,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"status.posting.no-emojis" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
"stringUnit" : {
|
||||
"state" : "translated",
|
||||
"value" : "No custom emojis"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"status.posting.placeholder" : {
|
||||
"localizations" : {
|
||||
"en" : {
|
||||
|
Loading…
x
Reference in New Issue
Block a user