Skip to content

Commit

Permalink
Update Musadora app with the 100 best albums view
Browse files Browse the repository at this point in the history
  • Loading branch information
rudrankriyam committed May 20, 2024
1 parent 18dc611 commit 291c646
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"location" : "https://github.com/rryam/MusadoraKit",
"state" : {
"branch" : "main",
"revision" : "36ee64f6eeace2afdde88c47ac13802cba11d5b5"
"revision" : "18dc61136bcb5b4aa5717eb46b6ff83035c8b3eb"
}
}
],
Expand Down
13 changes: 7 additions & 6 deletions Musadora/Musadora/Recommendations/RecommendationsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,33 @@ struct RecommendationsView: View {
NavigationListStack("Recommendations") {

Section("100 Best Albums") {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 200))], spacing: 20) {
LazyVGrid(columns: [GridItem(.adaptive(minimum: 250))], spacing: 20) {
ForEach(hundredBestAlbums) { album in
Button(action: {
Task {
let detailedAlbum = try await MCatalog.album(id: album.id, fetch: .tracks)
try await APlayer.shared.play(album: detailedAlbum)
}
}, label: {
VStack {
ArtworkImage(album.artwork, width: 200, height: 200)
VStack(alignment: .leading) {
ArtworkImage(album.artwork, width: 250, height: 250)
.cornerRadius(16)

Text(album.title)
.font(.title2)
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.top)
.lineLimit(1)

Text(album.artistName)
.font(.headline)
.foregroundColor(.secondary)
.frame(maxWidth: .infinity, alignment: .leading)
.lineLimit(1)
}
.padding()
.padding(8)
.contentShape(RoundedRectangle(cornerRadius: 24))
.hoverEffect()
})
.buttonStyle(.plain)
}
}
.padding(.horizontal)
Expand Down

0 comments on commit 291c646

Please sign in to comment.