Match album page reference layout
This commit is contained in:
1 parent
1e6bb30b50
commit
d6b35fe346
4 files changed
+136
-111
No files matched your search
@@ -118,24 +118,7 @@ private struct HomeAlbumCard: View {
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 5) {
|
||||
AsyncImage(url: artworkURL) { phase in
|
||||
switch phase {
|
||||
case .success(let image):
|
||||
image
|
||||
.resizable()
|
||||
.scaledToFill()
|
||||
case .empty:
|
||||
ProgressView()
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(.quaternary)
|
||||
case .failure:
|
||||
artworkPlaceholder
|
||||
@unknown default:
|
||||
artworkPlaceholder
|
||||
}
|
||||
}
|
||||
.aspectRatio(1, contentMode: .fit)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous))
|
||||
AlbumArtworkView(url: artworkURL)
|
||||
|
||||
Text(album.name)
|
||||
.font(.subheadline.weight(.medium))
|
||||
@@ -152,13 +135,6 @@ private struct HomeAlbumCard: View {
|
||||
.accessibilityElement(children: .combine)
|
||||
}
|
||||
|
||||
private var artworkPlaceholder: some View {
|
||||
Image(systemName: "music.note")
|
||||
.font(.largeTitle)
|
||||
.foregroundStyle(.secondary)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background(.quaternary)
|
||||
}
|
||||
}
|
||||
|
||||
private struct HomeAlbumCard_Previews: PreviewProvider {
|
||||
|
||||
Reference in new issue
Block a user