Revert "Add loading status to vertical cells"

This reverts commit c6cff4dee4.
This commit is contained in:
Arkadiusz Fal
2023-06-07 22:32:54 +02:00
parent 5ee869c02c
commit 56c2e552f7
12 changed files with 127 additions and 178 deletions

View File

@@ -42,9 +42,21 @@ struct FavoriteItemView: View {
.padding(.leading, 15)
#endif
if limitedItems.isEmpty {
EmptyItems(isLoading: resource?.isLoading ?? false) { reloadVisibleWatches() }
.padding(.vertical, 10)
if limitedItems.isEmpty, !(resource?.isLoading ?? false) {
VStack(alignment: .leading) {
Text(emptyItemsText)
.frame(maxWidth: .infinity, alignment: .leading)
.foregroundColor(.secondary)
if hideShorts || hideWatched {
AccentButton(text: "Disable filters", maxWidth: nil, verticalPadding: 0, minHeight: 30) {
hideShorts = false
hideWatched = false
reloadVisibleWatches()
}
}
}
.padding(.vertical, 10)
#if os(tvOS)
.padding(.horizontal, 40)
#else
@@ -101,6 +113,19 @@ struct FavoriteItemView: View {
}
}
var emptyItemsText: String {
var filterText = ""
if hideShorts && hideWatched {
filterText = "(watched and shorts hidden)"
} else if hideShorts {
filterText = "(shorts hidden)"
} else if hideWatched {
filterText = "(watched hidden)"
}
return "No videos to show".localized() + " " + filterText.localized()
}
var contextMenu: some View {
Group {
if item.section == .history {