summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Jel.xcodeproj/project.pbxproj4
-rw-r--r--Jel/Views/Dashboard/DashboardLibraryView.swift1
-rw-r--r--Jel/Views/Dashboard/DashboardSectionTitleView.swift30
-rw-r--r--Jel/Views/Dashboard/DashboardView.swift23
-rw-r--r--Jel/Views/Library/Item/ItemMediaView.swift14
5 files changed, 63 insertions, 9 deletions
diff --git a/Jel.xcodeproj/project.pbxproj b/Jel.xcodeproj/project.pbxproj
index eba3696..54d2e60 100644
--- a/Jel.xcodeproj/project.pbxproj
+++ b/Jel.xcodeproj/project.pbxproj
@@ -19,6 +19,7 @@
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */; };
3D41D1F52B2C962500E58234 /* AppearancePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D41D1F42B2C962500E58234 /* AppearancePicker.swift */; };
3D41D1FA2B2CAE0000E58234 /* LibraryIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D41D1F92B2CAE0000E58234 /* LibraryIconView.swift */; };
+ 3D4C15722B3CAA670035373E /* DashboardSectionTitleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D4C15712B3CAA670035373E /* DashboardSectionTitleView.swift */; };
3D7709392B29139700199889 /* Pulse in Frameworks */ = {isa = PBXBuildFile; productRef = 3D7709382B29139700199889 /* Pulse */; };
3D77093B2B29139700199889 /* PulseUI in Frameworks */ = {isa = PBXBuildFile; productRef = 3D77093A2B29139700199889 /* PulseUI */; };
3D8AB2A52B36440D005BD7D0 /* BlurHashDecode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D8AB2A42B36440D005BD7D0 /* BlurHashDecode.swift */; };
@@ -86,6 +87,7 @@
3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardLibraryView.swift; sourceTree = "<group>"; };
3D41D1F42B2C962500E58234 /* AppearancePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppearancePicker.swift; sourceTree = "<group>"; };
3D41D1F92B2CAE0000E58234 /* LibraryIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryIconView.swift; sourceTree = "<group>"; };
+ 3D4C15712B3CAA670035373E /* DashboardSectionTitleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DashboardSectionTitleView.swift; sourceTree = "<group>"; };
3D8AB2A42B36440D005BD7D0 /* BlurHashDecode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlurHashDecode.swift; sourceTree = "<group>"; };
3D8AB2A72B366353005BD7D0 /* LibraryDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryDetailView.swift; sourceTree = "<group>"; };
3D9063C72B279A310063DD2A /* Jel.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Jel.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -292,6 +294,7 @@
children = (
3DDD67922B293BC40026781E /* DashboardView.swift */,
3D16FC3B2B2CDFB500E6D8B3 /* DashboardLibraryView.swift */,
+ 3D4C15712B3CAA670035373E /* DashboardSectionTitleView.swift */,
);
path = Dashboard;
sourceTree = "<group>";
@@ -467,6 +470,7 @@
3DC6BA2D2B2A422300416B9F /* SettingsController.swift in Sources */,
3DAFA8E82B38AFED00D71AD1 /* ItemInfoView.swift in Sources */,
3D91FDCB2B28CA2500919017 /* SignInToServerView.swift in Sources */,
+ 3D4C15722B3CAA670035373E /* DashboardSectionTitleView.swift in Sources */,
3D16FC3C2B2CDFB500E6D8B3 /* DashboardLibraryView.swift in Sources */,
3D1015E42B28000E00F5C29A /* AuthStateController.swift in Sources */,
3D13F95F2B375DB800E91913 /* ItemView.swift in Sources */,
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())
-
//}