Move home and library titles higher

This commit is contained in:
lucast committed 2026-10-07 23:53:37 +02:00
1 parent 36220e46ea
commit fad462f5b4
4 files changed
+57 -41

No files matched your search

+1
View File
@@ -143,6 +143,7 @@ struct AlbumDetailView: View {
)
}
}
.toolbar(.visible, for: .navigationBar)
.navigationTitle("")
.navigationBarTitleDisplayMode(.inline)
.tint(.red)
+1 -1
View File
@@ -123,7 +123,7 @@ struct ArtistDetailView: View {
description: Text("This artist may no longer be available."))
}
}
.toolbar(.hidden, for: .navigationBar)
.toolbar(.visible, for: .navigationBar)
.navigationTitle("")
.navigationBarTitleDisplayMode(.inline)
.tint(.red)
+40 -33
View File
@@ -10,41 +10,49 @@ struct HomeView: View {
var body: some View {
NavigationStack {
ScrollView {
Group {
if viewModel.sections.isEmpty, viewModel.isLoading {
ProgressView()
.tint(.red)
.frame(maxWidth: .infinity)
.padding(.top, 72)
} else if viewModel.sections.isEmpty, let errorMessage = viewModel.errorMessage
{
ContentUnavailableView {
Label("Couldn't Load Home", systemImage: "wifi.exclamationmark")
} description: {
Text(errorMessage)
} actions: {
Button("Try Again") {
Task { await viewModel.load(forceRefresh: true) }
VStack(alignment: .leading, spacing: 0) {
Text("Home")
.font(.system(size: 34, weight: .bold))
.padding(.horizontal, 20)
.padding(.top, 4)
.padding(.bottom, 16)
Group {
if viewModel.sections.isEmpty, viewModel.isLoading {
ProgressView()
.tint(.red)
.frame(maxWidth: .infinity)
.padding(.top, 72)
} else if viewModel.sections.isEmpty, let errorMessage = viewModel.errorMessage
{
ContentUnavailableView {
Label("Couldn't Load Home", systemImage: "wifi.exclamationmark")
} description: {
Text(errorMessage)
} actions: {
Button("Try Again") {
Task { await viewModel.load(forceRefresh: true) }
}
.tint(.red)
}
.tint(.red)
}
.padding(.top, 48)
} else if viewModel.sections.isEmpty {
ContentUnavailableView(
"No Albums Yet",
systemImage: "square.stack",
description: Text("There are no albums to show right now.")
)
.padding(.top, 48)
} else {
LazyVStack(alignment: .leading, spacing: 26) {
ForEach(viewModel.sections) { section in
HomeAlbumCarousel(section: section) { album in
viewModel.artworkURL(for: album)
.padding(.top, 48)
} else if viewModel.sections.isEmpty {
ContentUnavailableView(
"No Albums Yet",
systemImage: "square.stack",
description: Text("There are no albums to show right now.")
)
.padding(.top, 48)
} else {
LazyVStack(alignment: .leading, spacing: 26) {
ForEach(viewModel.sections) { section in
HomeAlbumCarousel(section: section) { album in
viewModel.artworkURL(for: album)
}
}
}
.padding(.vertical, 20)
}
.padding(.vertical, 20)
}
}
}
@@ -52,8 +60,7 @@ struct HomeView: View {
.refreshable {
await viewModel.load(forceRefresh: true)
}
.navigationTitle("Home")
.navigationBarTitleDisplayMode(.large)
.toolbar(.hidden, for: .navigationBar)
.tint(.red)
}
.task {
+15 -7
View File
@@ -146,13 +146,21 @@ private struct TabAccessoryVisibilityBridge: UIViewControllerRepresentable {
private struct LibraryTabView: View {
var body: some View {
NavigationStack {
ContentUnavailableView(
"Your Library",
systemImage: "books.vertical",
description: Text("Your saved songs will appear here.")
)
.navigationTitle("Library")
.navigationBarTitleDisplayMode(.large)
VStack(alignment: .leading, spacing: 0) {
Text("Library")
.font(.system(size: 34, weight: .bold))
.padding(.horizontal, 20)
.padding(.top, 4)
.padding(.bottom, 16)
ContentUnavailableView(
"No Saved Songs",
systemImage: "books.vertical",
description: Text("Your saved songs will appear here.")
)
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
.toolbar(.hidden, for: .navigationBar)
}
}
}