Revert "Fix images layout"

This reverts commit ee6e2370d2.
This commit is contained in:
Arkadiusz Fal
2022-09-11 21:21:50 +02:00
parent 6ec59cf442
commit b320ffb540
5 changed files with 80 additions and 79 deletions

View File

@@ -32,30 +32,28 @@ struct ChapterView: View {
}
@ViewBuilder func smallImage(_ chapter: Chapter) -> some View {
Group {
if #available(iOS 15, macOS 12, *) {
CachedAsyncImage(url: chapter.image) { image in
image
.resizable()
} placeholder: {
Rectangle().foregroundColor(Color("PlaceholderColor"))
}
} else {
WebImage(url: chapter.image)
if #available(iOS 15, macOS 12, *) {
CachedAsyncImage(url: chapter.image) { image in
image
.resizable()
.placeholder {
ProgressView()
}
.indicator(.activity)
} placeholder: {
Rectangle().foregroundColor(Color("PlaceholderColor"))
}
} else {
WebImage(url: chapter.image)
.resizable()
.placeholder {
ProgressView()
}
.indicator(.activity)
#if os(tvOS)
.frame(width: thumbnailWidth, height: 140)
.mask(RoundedRectangle(cornerRadius: 12))
#else
.frame(width: thumbnailWidth, height: 60)
.mask(RoundedRectangle(cornerRadius: 6))
#endif
}
#if os(tvOS)
.frame(width: thumbnailWidth, height: 140)
.mask(RoundedRectangle(cornerRadius: 12))
#else
.frame(width: thumbnailWidth, height: 60)
.mask(RoundedRectangle(cornerRadius: 6))
#endif
}
private var thumbnailWidth: Double {