diff options
Diffstat (limited to 'Jel/Views/Dashboard')
-rw-r--r-- | Jel/Views/Dashboard/DashboardLibraryView.swift (renamed from Jel/Views/Dashboard/Library/LibraryView.swift) | 12 | ||||
-rw-r--r-- | Jel/Views/Dashboard/DashboardView.swift | 10 | ||||
-rw-r--r-- | Jel/Views/Dashboard/Library/LibraryIconView.swift | 38 |
3 files changed, 13 insertions, 47 deletions
diff --git a/Jel/Views/Dashboard/Library/LibraryView.swift b/Jel/Views/Dashboard/DashboardLibraryView.swift index 63bfd64..98c92c0 100644 --- a/Jel/Views/Dashboard/Library/LibraryView.swift +++ b/Jel/Views/Dashboard/DashboardLibraryView.swift @@ -1,5 +1,5 @@ // -// LibraryView.swift +// DashboardLibraryView.swift // Jel // // Created by zerocool on 12/15/23. @@ -8,7 +8,7 @@ import SwiftUI import JellyfinKit -struct LibraryView: View { +struct DashboardLibraryView: View { @EnvironmentObject var jellyfinClient: JellyfinClientController @StateObject var authState: AuthStateController = AuthStateController.shared @@ -19,7 +19,12 @@ struct LibraryView: View { HStack { ForEach(libraries) {library in if library.collectionType == "movies" || library.collectionType == "tvshows" { - LibraryIconView(library: library) + NavigationLink { + LibraryDetailView(library: library) + } label: { + LibraryIconView(library: library, height: 200) + .padding() + } } } } @@ -32,7 +37,6 @@ struct LibraryView: View { libraries = results } } catch { - print(error) } } } diff --git a/Jel/Views/Dashboard/DashboardView.swift b/Jel/Views/Dashboard/DashboardView.swift index 2658180..50d3538 100644 --- a/Jel/Views/Dashboard/DashboardView.swift +++ b/Jel/Views/Dashboard/DashboardView.swift @@ -14,10 +14,10 @@ struct DashboardView: View { var body: some View { NavigationStack { VStack { - LibraryView() + DashboardLibraryView() } .toolbar { - ToolbarItem { + ToolbarItem(placement: .topBarTrailing) { Button { showingSettingsSheet.toggle() } label: { @@ -32,6 +32,6 @@ struct DashboardView: View { } } -#Preview { - DashboardView() -} +//#Preview { +// DashboardView() +//} diff --git a/Jel/Views/Dashboard/Library/LibraryIconView.swift b/Jel/Views/Dashboard/Library/LibraryIconView.swift deleted file mode 100644 index 0131ff7..0000000 --- a/Jel/Views/Dashboard/Library/LibraryIconView.swift +++ /dev/null @@ -1,38 +0,0 @@ -// -// LibraryIconView.swift -// Jel -// -// Created by zerocool on 12/15/23. -// - -import SwiftUI -import JellyfinKit -import BlurHashKit - -struct LibraryIconView: View { - @EnvironmentObject var jellyfinClient: JellyfinClientController - - @State var library: BaseItemDto - @State var loadingImage: Bool = true - - @State var loadedImageBinaryData: Data? - - var body: some View { - VStack { - AsyncImageView(imageId: library.id ?? "", - blurhash: library.imageBlurHashes?.primary?[library.imageTags?["Primary"] ?? ""] ?? "", - imageType: "Primary") - .aspectRatio(contentMode: .fill) - .frame(width: 255, height: 150) - .clipShape(RoundedRectangle(cornerRadius: 5)) - - - Text(library.name ?? "Unknown") - .font(.subheadline) - } - } -} - -//#Preview { -// LibraryIconView(library: BaseItemDto()) -//} |