Move home and library titles higher
This commit is contained in:
1 parent
36220e46ea
commit
fad462f5b4
4 files changed
+57
-41
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user