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