diff options
Diffstat (limited to 'Jel')
-rw-r--r-- | Jel/Views/Dashboard/DashboardLibraryView.swift | 1 | ||||
-rw-r--r-- | Jel/Views/Dashboard/DashboardSectionTitleView.swift | 30 | ||||
-rw-r--r-- | Jel/Views/Dashboard/DashboardView.swift | 23 | ||||
-rw-r--r-- | Jel/Views/Library/Item/ItemMediaView.swift | 14 |
4 files changed, 59 insertions, 9 deletions
diff --git a/Jel/Views/Dashboard/DashboardLibraryView.swift b/Jel/Views/Dashboard/DashboardLibraryView.swift index 4a68013..7526dce 100644 --- a/Jel/Views/Dashboard/DashboardLibraryView.swift +++ b/Jel/Views/Dashboard/DashboardLibraryView.swift @@ -30,7 +30,6 @@ struct DashboardLibraryView: View { } label: { LibraryIconView(library: library, height: 150) .setAspectRatio(library.primaryImageAspectRatio) - .padding() } .buttonStyle(PlainButtonStyle()) } diff --git a/Jel/Views/Dashboard/DashboardSectionTitleView.swift b/Jel/Views/Dashboard/DashboardSectionTitleView.swift new file mode 100644 index 0000000..2456dc2 --- /dev/null +++ b/Jel/Views/Dashboard/DashboardSectionTitleView.swift @@ -0,0 +1,30 @@ +// +// DashboardSectionTitleView.swift +// Jel +// +// Created by zerocool on 12/27/23. +// + +import SwiftUI + +struct DashboardSectionTitleView: View { + @State var titleText: String + + init(_ title: String) { + self.titleText = title + } + + var body: some View { + HStack { + Text(titleText) + .font(.title2) + .bold() + Spacer() + } + .padding(.top) + } +} + +#Preview { + DashboardSectionTitleView("Title") +} diff --git a/Jel/Views/Dashboard/DashboardView.swift b/Jel/Views/Dashboard/DashboardView.swift index b3c223b..279f056 100644 --- a/Jel/Views/Dashboard/DashboardView.swift +++ b/Jel/Views/Dashboard/DashboardView.swift @@ -12,12 +12,27 @@ struct DashboardView: View { @State var showingSettingsSheet: Bool = false var body: some View { - VStack { - NavigationStack { - DashboardLibraryView() - .navigationTitle("Home") + ScrollView { + LazyVStack { + Section { + NavigationStack { + DashboardLibraryView() + } + } header: { + DashboardSectionTitleView("Libraries") + } + + Section { + NavigationStack { + DashboardLibraryView() + } + } header: { + DashboardSectionTitleView("Next up") + } } + .padding() } + .navigationTitle("Home") .toolbar { ToolbarItem(placement: .topBarTrailing) { Button { diff --git a/Jel/Views/Library/Item/ItemMediaView.swift b/Jel/Views/Library/Item/ItemMediaView.swift index a3f653a..dfb6c7a 100644 --- a/Jel/Views/Library/Item/ItemMediaView.swift +++ b/Jel/Views/Library/Item/ItemMediaView.swift @@ -18,7 +18,7 @@ struct ItemMediaView: View { @State var navigationTitle: String = "" var body: some View { - VStack { + GeometryReader {geo in if loading { ProgressView() .progressViewStyle(.circular) @@ -50,14 +50,21 @@ struct ItemMediaView: View { Text(overview) } } - .padding() + .if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) > 0) {view in + view + .padding(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing)) + } + .if(max(geo.safeAreaInsets.leading, geo.safeAreaInsets.trailing) <= 0) {view in + view + .padding() + } } + .ignoresSafeArea() } } .toolbarRole(.editor) .navigationBarTitleDisplayMode(.inline) .navigationTitle(navigationTitle) - .ignoresSafeArea() .scrollIndicators(.hidden) .onAppear { Task { @@ -75,5 +82,4 @@ struct ItemMediaView: View { //#Preview { // ItemMovieView(item: BaseItemDto()) - //} |