Add loading status to vertical cells

This commit is contained in:
Arkadiusz Fal
2023-05-27 01:14:48 +02:00
parent eaeaa45422
commit c6cff4dee4
12 changed files with 177 additions and 126 deletions

View File

@@ -70,7 +70,7 @@ struct PlaylistVideosView: View {
}
var body: some View {
VerticalCells(items: contentItems)
VerticalCells(items: contentItems, isLoading: resource?.isLoading ?? false)
.onAppear {
guard contentItems.isEmpty else { return }
loadResource()

View File

@@ -63,13 +63,11 @@ struct PlaylistsView: View {
var body: some View {
SignInRequiredView(title: "Playlists".localized()) {
VStack {
VerticalCells(items: items, allowEmpty: true) { if shouldDisplayHeader { header } }
VerticalCells(items: items, isLoading: resource?.isLoading ?? false) { if shouldDisplayHeader { header } }
.environment(\.currentPlaylistID, currentPlaylist?.id)
.environment(\.listingStyle, playlistListingStyle)
if currentPlaylist != nil, items.isEmpty {
hintText("Playlist is empty\n\nTap and hold on a video and then \n\"Add to Playlist\"".localized())
} else if model.all.isEmpty {
if model.all.isEmpty {
hintText("You have no playlists\n\nTap on \"New Playlist\" to create one".localized())
}
}